Hi friends,in this article i will explain about How to get the
Month Names in DropDownList in ASP.NET.
I already explained in previous about Maintain The State Of Checkbox After Postback (Inside GridView),JQuery:Check Uncheck all CheckBoxes in ASP.Net CheckBoxList control and How to get selected text of CheckBoxList and align CheckBoxList Horizontal in ASP.NET using C#/VB.NET
I already explained in previous about Maintain The State Of Checkbox After Postback (Inside GridView),JQuery:Check Uncheck all CheckBoxes in ASP.Net CheckBoxList control and How to get selected text of CheckBoxList and align CheckBoxList Horizontal in ASP.NET using C#/VB.NET
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to
get the Month Names in DropDownList in ASP.NET</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ddlMonth" runat="server" AutoPostBack="true">
<asp:ListItem Value="0" Text="--Select--"></asp:ListItem>
<asp:ListItem Value="1" Text="Jan"></asp:ListItem>
<asp:ListItem Value="2" Text="Feb"></asp:ListItem>
<asp:ListItem Value="3" Text="Mar"></asp:ListItem>
<asp:ListItem Value="4" Text="Apr"></asp:ListItem>
<asp:ListItem Value="5" Text="May"></asp:ListItem>
<asp:ListItem Value="6" Text="June"></asp:ListItem>
<asp:ListItem Value="7" Text="July"></asp:ListItem>
<asp:ListItem Value="8" Text="Aug"></asp:ListItem>
<asp:ListItem Value="9" Text="Sept"></asp:ListItem>
<asp:ListItem Value="10" Text="Oct"></asp:ListItem>
<asp:ListItem Value="11" Text="Nov"></asp:ListItem>
<asp:ListItem Value="12" Text="Dec"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="ddlDay" runat="server">
</asp:DropDownList>
<asp:Button ID="btnGetDate" runat="server" Text="Get date" />
</div>
</form>
</body>
</html>
|
The output of the above code as shown in the below figure.
No comments:
Post a Comment