Array type Server Control Property

Posted on 2007-10-02
Last Modified: 2013-12-17
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#.  
Question by:kosturdur
    1 Comment
    LVL 7

    Accepted 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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now