有控件dropdownlist1
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="1">aa</asp:ListItem>
<asp:ListItem Value="2">bb</asp:ListItem>
<asp:ListItem Value="3">cc</asp:ListItem>
<asp:ListItem Value="4">dd</asp:ListItem>
<asp:ListItem Value="5">ee</asp:ListItem>
</asp:DropDownList>
现从数据库中返回值为cc,要dropdownlist1默认选择cc:
DropDownList1.Items.FindByText("cc").Selected= true;
如数据库中存储的为value值:
Dropdownlist1.Items.FindByValue("cc").Selected = true