Click here to Skip to main content
15,796,734 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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 :

I am open to all suggestions.

Thanks in avance to everybody.
<br />
------------RELATED .aspx code --------------<br />
<br />
<asp:DropDownList ID="ddlCatalogueName" runat="server" Width="180px" AutoPostBack="true" />
<br />
<asp:DropDownList ID="ddlMainGroup" runat="server" Width="180px" AutoPostBack="true" />
<br />
<asp:DropDownList ID="ddlSubGroup" runat="server" Width="180px" AutoPostBack="true" />
<br />
<asp:DropDownList ID="ddlPageNumbers" runat="server" Width="60px" AutoPostBack="true" />
<br />

<ajaxToolkit:CascadingDropDown ID="cddCatalogueName" runat="server" TargetControlID="ddlCatalogueName" Category="CatalogueName" PromptText="Choose a Catalogue..." LoadingText="Please wait ..." ServicePath="Catalogue.asmx"

 <ajaxToolkit:CascadingDropDown ID="cddMainGroup"  runat="server" TargetControlID="ddlMainGroup"  ParentControlID="ddlCatalogueName"  Category="MainGroup" PromptText="Choose a Group..."   LoadingText="Please wait ..."   ServicePath="Catalogue.asmx"  ServiceMethod="GetMainGroup" >

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

 <ajaxToolkit:CascadingDropDown ID="cddPageNumbers"  runat="server" TargetControlID="ddlPageNumbers"  ParentControlID="ddlSubGroup"  Category="Pages"  LoadingText="Please wait ..."  ServicePath="Catalogue.asmx"  ServiceMethod="GetPageNumbers" SelectedValue="1"  >
</pre><br />
------------ END OFRELATED .aspx code --------------
Updated 8-Mar-10 0:01am

1 solution

Have you tried defining an onchange event of "ddlSubGroup" in code behind where you reset the "ddlPageNumbers"?

You can also try client side script on change of "ddlSubGroup". Reset the "ddlPageNumbers" client side itself.
ddlSubGroup.Attributes.Add("onchange", "javascript:ResetPageNoDDL();");
Share this answer

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