DropDownList

Discussion in 'ASP General' started by Ana Rita, Sep 4, 2003.

  1. Ana Rita

    Ana Rita Guest

    Hello to all.

    I´m trying to use a string, to build the ListItem's of a
    DropDownList.

    I declare a Public str as string in the webform1.aspx.vb,
    and in the page load I build the string like this:

    str = "<asp:ListItem value='0'>Blue</asp:ListItem>
    <asp:ListItem value='1'>Red</asp:ListItem>"

    In the webform1.aspx, html mode, I call the str within the
    tag <asp:DropDownList>, like this <%str%>. As I expected,
    it gives an error, saying that I can't use this type of
    calls.

    I want to Know, if it's possible to do something like we
    do in asp to build a select object using a string with the
    <options>.

    Thank you all.

    Best wishes.

    Ana Rita
     
    Ana Rita, Sep 4, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,678
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,273
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,899
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  4. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,338
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. keithb
    Replies:
    1
    Views:
    12,175
    shauns1
    Nov 1, 2006
Loading...

Share This Page