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#.  
Who is Participating?
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.