问题描述
我已经搜索了很多天,但是找不到答案,
我会在这里尝试非常具体:
1)我有4个Cascading DropDown命名(每个都连接到ajaxToolkit:CascadingDropDown扩展器)
2)下拉列表按以下顺序命名(asp代码如下)
ddlCatalogueName> ddlMainGroup> ddlSubGroup> ddlPageNumbers,
3)ddlPageNumbers是ddlSubGroup的子项,并且ddlPageNumbers包含的项目始终从1开始,然后一直到页数(例如1/2/3或1/2/3/4或仅1)
4)选择ddlPageNumbers项后,当我想移到另一个子组(ddlSubGroup)时,ddlPageNumbers不会恢复为1,它保持不变(2-3-4,无论我之前选择的是什么)
我需要一种方法时,选择了另一ddlSubGroup重置ddlPageNumbers.
可以在以下示例中找到一个工作示例:
www.turkeyautospareparts.com/catalogue.aspx
我愿意接受所有建议.
在此先感谢大家.
Hi,
I''ve been googling for many days now but can''t find an answer ,
I''ll try to be very specific here:
1) I have 4 Cascading DropDown named (each connected to ajaxToolkit:CascadingDropDown extender)
2) The dropdowns are named in the following order (asp code below )
ddlCatalogueName > ddlMainGroup > ddlSubGroup > ddlPageNumbers ,
3)ddlPageNumbers is child of ddlSubGroup , and ddlPageNumbers contains items always starting from 1 and then upto number of pages (ex. 1/2/3 or 1/2/3/4 or only 1)
4) After selecting a ddlPageNumbers item, when i want to move to another Subgroup (ddlSubGroup) ,ddlPageNumbers doesn''t revert back to 1 , it stays the same (2-3-4 whatever i previously chose)
I need a way to reset ddlPageNumbers , when another ddlSubGroup is selected.
A working example can be seen at :
www.turkeyautospareparts.com/catalogue.aspx
I am open to all suggestions.
Thanks in avance to everybody.
<br />
------------RELATED .aspx code --------------<br />
<br />
<pre><br />
<asp:DropDownList ID="ddlCatalogueName" runat="server" Width="180px" AutoPostBack="true" /><br />
<br /><br />
<asp:DropDownList ID="ddlMainGroup" runat="server" Width="180px" AutoPostBack="true" /><br />
<br /><br />
<asp:DropDownList ID="ddlSubGroup" runat="server" Width="180px" AutoPostBack="true" /><br />
<br /><br />
<asp:DropDownList ID="ddlPageNumbers" runat="server" Width="60px" AutoPostBack="true" /><br />
<br /><br />
<br />
<ajaxToolkit:CascadingDropDown ID="cddCatalogueName" runat="server" TargetControlID="ddlCatalogueName" Category="CatalogueName" PromptText="Choose a Catalogue..." LoadingText="Please wait ..." ServicePath="Catalogue.asmx"<br />
ServiceMethod="GetCatalogueName"><br />
</ajaxToolkit:CascadingDropDown><br />
<br />
<ajaxToolkit:CascadingDropDown ID="cddMainGroup" runat="server" TargetControlID="ddlMainGroup" ParentControlID="ddlCatalogueName" Category="MainGroup" PromptText="Choose a Group..." LoadingText="Please wait ..." ServicePath="Catalogue.asmx" ServiceMethod="GetMainGroup" ><br />
</ajaxToolkit:CascadingDropDown><br />
<br />
<ajaxToolkit:CascadingDropDown ID="cddSubGroup" runat="server" TargetControlID="ddlSubGroup" ParentControlID="ddlMainGroup" Category="SubGroup" PromptText="Choose a Sub Group..." LoadingText="Please wait ..." ServicePath="Catalogue.asmx" ServiceMethod="GetSubGroup" ><br />
</ajaxToolkit:CascadingDropDown><br />
<br />
<ajaxToolkit:CascadingDropDown ID="cddPageNumbers" runat="server" TargetControlID="ddlPageNumbers" ParentControlID="ddlSubGroup" Category="Pages" LoadingText="Please wait ..." ServicePath="Catalogue.asmx" ServiceMethod="GetPageNumbers" SelectedValue="1" ><br />
</ajaxToolkit:CascadingDropDown><br />
</pre><br />
------------ END OFRELATED .aspx code --------------</pre><br />
<br />
推荐答案
ddlSubGroup.Attributes.Add("onchange", "javascript:ResetPageNoDDL();");
这篇关于重置级联下拉值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!