G
Guest
Hi,
I am sure this is a common question, but I could not find an answer...
I have a DataList tag in which the EditItemTemplate has an item that should
only set the database field to one of a few options.
Seemingly a Drop Down List is the way to go.
However, when the user selects a record to edit, how can I "pre select" the
item in the dropDownList to reflect what is currently in the database?
See code below.
Any help or sample code in VB would be great.
Thanks,
David
--------------------------------
My code is in VB.net and looks like this:
<asp
ataList>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "datafield") %>
</ItemTemplate>
<EditItemTemplate>
<asp
ropDownList>
<asp:ListItem value="opt1">opt1</asp:ListItem>
<asp:ListItem value="opt2">opt2</asp:ListItem>
<asp:ListItem value="opt3">opt3</asp:ListItem>
</asp
ropDownList>
</EditItemTemplate>
</asp
ataList>
I am sure this is a common question, but I could not find an answer...
I have a DataList tag in which the EditItemTemplate has an item that should
only set the database field to one of a few options.
Seemingly a Drop Down List is the way to go.
However, when the user selects a record to edit, how can I "pre select" the
item in the dropDownList to reflect what is currently in the database?
See code below.
Any help or sample code in VB would be great.
Thanks,
David
--------------------------------
My code is in VB.net and looks like this:
<asp
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "datafield") %>
</ItemTemplate>
<EditItemTemplate>
<asp
<asp:ListItem value="opt1">opt1</asp:ListItem>
<asp:ListItem value="opt2">opt2</asp:ListItem>
<asp:ListItem value="opt3">opt3</asp:ListItem>
</asp
</EditItemTemplate>
</asp