• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

Array type Server Control Property

I have a server control that needs an array of strings.
How you manage this?
I could add a property of type string like;
public virtual string Items{get{}set{}}
and when the developer fills the property like;
then I can pick the strings from that property for my use but is this the right way?

I search the web to find a property (Designer) that takes items like  a listview, a combobox but could find anything.
I'm using VS 2005 Asp.Net with C#.  
1 Solution
Have you tried creating a property that is a list of objects to hold the strings. Then decorate that property with

Sort of like this

public List<TheString> _listOfStrings;
public List<TheString> ListOfStrings
get { return _listOfStrings; }
set { _listOfStrings = value; }

Then at design time your ASP control can be marked up like so

<cc1:webcustomcontrol1 id="WebCustomControl1_1" runat="server">
<ListOfStrings >
<cc1:TheString StringValue="one" />
<cc1:TheString StringValue="two" />
<cc1:TheString StringValue="three" />
<cc1:TheString StringValue="four" />

Check out http://msdn2.microsoft.com/en-us/library/system.web.ui.persistencemode(VS.80).aspx

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now