Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My dropdownlist is
XML
<asp:DropDownList ID="ddl1Board" runat="server" ValidationGroup="StdAdm">
                                                           <asp:ListItem Selected="True">CBSE</asp:ListItem>
                                                           <asp:ListItem>ICSE</asp:ListItem>
                                                   <asp:ListItem>BSEB</asp:ListItem>
                                                   </asp:DropDownList>


My dropdownlist value save in database. but i retrieve the database value then i not understand how to select the dropdownlist value selected.
for example:-
I save the bseb in database and retrieve the bseb in database then i want to user see to bseb is selected.
Posted

1 solution

If you are saving the Item text then you can retrieve selected item as
DropDownList1.SelectedValue= ValuefromDatabase;

If you are using Index.
DropDownList1.SelectedIndex=2(In this case);
 
Share this answer
 
Comments
Rakesh From Patna 12-Apr-11 4:41am    
Thanks
m@dhu 12-Apr-11 4:56am    
welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900