R
Ron
I am trying to use code to create a dropdownlist box that has different
values than text for instance:
<aspropDownList id="someID" runat="server">
<asp:listitem value="12345">ABCDE</asp:listitem>
<asp:listitem value="98765">FGHIJ</asp:listitem>
</aspropDownList>
I am using code similar to the following:
----------------------------------------------------
dim ddListItemCollection as New ListItemCollection
dim i as integer
dim strI as string
for i = 0 to 3
strI = "Some string based on i"
ddListItemCollection.Add(New ListItem(strI,i))
next
------------------------------------------------------------
This should render HTML something like
<select name="SomeName" id="SomeID">
<option value="0">Some string based on 0</option>
<option value="1">Some string based on 1</option>
<option value="2">Some string based on 2</option>
<option value="3">Some string based on 3</option>
</select>
But it is coming out like this:
<select name="SomeName" id="SomeID">
<option value="Some string based on 0">Some string based on 0</option>
<option value="Some string based on 1">Some string based on 1</option>
<option value="Some string based on 2">Some string based on 2</option>
<option value="Some string based on 3">Some string based on 3</option>
</select>
where the Value attribute is taking it's value from the text property.
I need to set the value as something different than the text. Any help you
all can offer will be appreciated.
Thanks,
Ron
values than text for instance:
<aspropDownList id="someID" runat="server">
<asp:listitem value="12345">ABCDE</asp:listitem>
<asp:listitem value="98765">FGHIJ</asp:listitem>
</aspropDownList>
I am using code similar to the following:
----------------------------------------------------
dim ddListItemCollection as New ListItemCollection
dim i as integer
dim strI as string
for i = 0 to 3
strI = "Some string based on i"
ddListItemCollection.Add(New ListItem(strI,i))
next
------------------------------------------------------------
This should render HTML something like
<select name="SomeName" id="SomeID">
<option value="0">Some string based on 0</option>
<option value="1">Some string based on 1</option>
<option value="2">Some string based on 2</option>
<option value="3">Some string based on 3</option>
</select>
But it is coming out like this:
<select name="SomeName" id="SomeID">
<option value="Some string based on 0">Some string based on 0</option>
<option value="Some string based on 1">Some string based on 1</option>
<option value="Some string based on 2">Some string based on 2</option>
<option value="Some string based on 3">Some string based on 3</option>
</select>
where the Value attribute is taking it's value from the text property.
I need to set the value as something different than the text. Any help you
all can offer will be appreciated.
Thanks,
Ron