Soumya Ps

Soumya Ps

  • NA
  • 148
  • 17.7k

dropdown in asp.net

Apr 14 2018 1:48 AM
I have three dropdown for Day,Month,Year
in each dropdown i added these lines of code
ddlDay.Items.FindByValue(System.DateTime.Now.AddDays(-1).Day.ToString()).Selected = true;
but i want to show it as
DD selected as in dropdown Day
MM selected as in dropdown Month
YYYY selected as in dropdown Year
I also use
<asp:DropDownList ID="ddlMonth" runat="server" class="form-control"> <asp:ListItem Value="-1">MM</asp:ListItem> </asp:DropDownList>
these lines to each drop down but it not working
Pls help me..Thanks in Advance

Answers (3)