list control and default to selected item?

  • Thread starter Thread starter Moe Sizlak
  • Start date Start date
M

Moe Sizlak

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>
 
Hi,

I use this:
lst1.SelectedValue = myValue;

HTH,
Stefano Mostarda MCP
Rome Italy
 
Back
Top