使用下拉列表事件显示数据 [英] Using dropdownlist event for displaying data

查看:71
本文介绍了使用下拉列表事件显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有两个下拉列表,如下所示:

Hi all,

I have two dropdownlists as below:

<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>



在这里,我可以使用pageload事件绑定"ddlDay"中的数据.
但是,当我在"ddlMonth"中选择特定月份时,我希望数据显示在"ddlDay"中.

请任何人告诉我应该使用哪个事件来进行此操作.

问候,



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,

推荐答案

ddlMonth_SelectedIndexChanged事件中绑定ddlDay下拉列表,并为ddlMonth下拉列表设置autopostback=true.
Bind the ddlDay dropdown in ddlMonth_SelectedIndexChanged event and set autopostback=true for ddlMonth dropdownlist.


这篇关于使用下拉列表事件显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆