selected drop down value

H4ck3r1n4

New Member
hello people..<BR>lets say i query a value from a database, and i would like the value to be in a dropdownlist as well as a specific value selected. how can i get this done?<BR>lets the value in my dropdownlist will be<BR><asp:dropdownlist id="ddl" runat=server><BR>cat<BR>dog<BR>cow<BR>mouse<BR></asp:dropdownlist><BR><BR>and i want cow to be a selected value..if i own a cow.. how cani get this done people.. this purpose of selection will be for my edit mode.<BR>thanks in advance.You can use this:<BR><BR>ddl.Items.FindByValues("cow").Selected = true;
 
Back
Top