Link to home
Start Free TrialLog in
Avatar of MikeMCSD
MikeMCSDFlag for United States of America

asked on

Drop Down List code

I'm populating a drop down list dynamically in code, but
I want to add this after:

   Text="Select Year"    Value="0"    Selected="True"

<asp:DropDownList ID="ddlDOBY" runat="server">

I can do it VB but I need it in C# . . which I'm still struggling to learn.  thanks
Avatar of Rejojohny
Rejojohny
Flag of United States of America image

Where are you dynmically populating the dropdown? just below that code
i.e below ddlDOBY.DataBind();

write
ddlDOBY.Items.Insert(0, new listitem("0", "Select Year"));
ASKER CERTIFIED SOLUTION
Avatar of Rejojohny
Rejojohny
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MikeMCSD

ASKER

that did the trick, thanks Rejo