Click here to Skip to main content
14,452,327 members
Rate this:
Please Sign up or sign in to vote.
See more:
My dropdownlist is
<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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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);
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100