Dropdownlist

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ana Rita

    #1

    Dropdownlist

    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.v b,
    and in the page load I build the string like this:

    str = "<asp:ListI tem 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:DropDownLi st>, 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



Working...