Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have two dropdownlists as below:

XML
<asp:DropDownList ID="ddlMonth" runat="server"                                                onselectedindexchanged="ddlMonth_SelectedIndexChanged">       <asp:ListItem Text="Select" Value="0"></asp:ListItem>
<asp:ListItem Text="Jan" Value="1"></asp:ListItem>
<asp:ListItem Text="Feb" Value="2"></asp:ListItem>
<asp:ListItem Text="Mar" Value="3"></asp:ListItem>
<asp:ListItem Text="Apr" Value="4"></asp:ListItem>
<asp:ListItem Text="May" Value="5"></asp:ListItem>
<asp:ListItem Text="June" Value="6"></asp:ListItem>                               <asp:ListItem Text="July" Value="7"></asp:ListItem>
<asp:ListItem Text="Aug" Value="8"></asp:ListItem>
<asp:ListItem Text="Sep" Value="9"></asp:ListItem>
<asp:ListItem Text="Oct" Value="10"></asp:ListItem>
<asp:ListItem Text="Nov" Value="11"></asp:ListItem>
<asp:ListItem Text="Dec" Value="12"></asp:ListItem>
</asp:DropDownList>
                                             &nbsp;&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID="ddlDay" runat="server" Style="z-index: 131;"
TabIndex="3" Width="140px">
</asp:DropDownList>


Here, I am able to bind the data in "ddlDay" with using pageload event.
But, I want the data to be displayed in "ddlDay" when I select a particular month in "ddlMonth".

Please any one tell me which event should I use to do this.

Regards,
Posted

1 solution

Bind the ddlDay dropdown in ddlMonth_SelectedIndexChanged event and set autopostback=true for ddlMonth dropdownlist.
 
Share this answer
 
Comments
Raj.rcr 4-Mar-11 4:29am    
Thank you so much... Its working.
Ankit Kumar 3-Sep-12 7:12am    
If you want to show the selected month from drop downlist.then write the some line of codes in selectedIndex changed.you have to take one label.
code:
Label1.Text = "You have selected :" + DropDownList1.SelectedItem.Text;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900