I want to bind the value of a field from a database to make a dropdownlist
default to that value, I can't seem to get to work correctly. It just
doesn't seem work no matter what I do, could someone help me with some code?
Moe <><
lst1.SelectedItem.Value = Trim(dr("frm1value"))
<ASP:DropDownList id=lst1 name=lst1 maxlength= "40" runat=server>
<asp:ListItem Value="something">something</asp:ListItem>
<asp:ListItem Value="NO">NO</asp:ListItem>
<asp:ListItem Value="YES">YES</asp:ListItem
</ASP:DropDownListHi,
I use this:
lst1.SelectedValue = myValue;
HTH,
Stefano Mostarda MCP
Rome Italy
Moe Sizlak wrote:
> Hi There,
> I want to bind the value of a field from a database to make a dropdownlist
> default to that value, I can't seem to get to work correctly. It just
> doesn't seem work no matter what I do, could someone help me with some code?
>
> Moe <><
>
> lst1.SelectedItem.Value = Trim(dr("frm1value"))
>
> <ASP:DropDownList id=lst1 name=lst1 maxlength= "40" runat=server>
> <asp:ListItem Value="something">something</asp:ListItem>
> <asp:ListItem Value="NO">NO</asp:ListItem>
> <asp:ListItem Value="YES">YES</asp:ListItem>
> </ASP:DropDownList>
>
0 comments:
Post a Comment