Showing posts with label share. Show all posts
Showing posts with label share. Show all posts

Wednesday, March 21, 2012

cascadingdropdown many child share one parent, child of child

I have 6 cdd structured as follows

cdd 1 (top most)

cdd 2 -> parent = 1

cdd 3 -> parent = 2

cdd 4 -> parent = 2

cdd 5 -> parent = 2

cdd 6 -> parent = 5

As you can see 3, 4 & 5 share the same parent. This works fine and all drop down populate = great ! When I add 6, where the parent is one of the children that share a parent, IE does not respond. If I click on the page I get (Not Responding) in the title bar and if I keep clicking I get the popup "The script is causing internet explorer to run slowly do you want to abort the script".

Code is here...

<ajaxToolKit:CascadingDropDownID="cddState"runat="server"TargetControlID="ddState"

Category="State"LoadingText="[Loading states...]"PromptText="-Please Select-"

ServiceMethod="GetTechnicalComboValues"ServicePath="Services\CascadeCombo.asmx"

Enabled="True">

</ajaxToolKit:CascadingDropDown>

<ajaxToolKit:CascadingDropDownID="cddSuburb"runat="server"TargetControlID="ddSuburb"

Category="Suburb"LoadingText="[Loading suburbs...]"PromptText="-Please Select-"

ServiceMethod="GetTechnicalComboValues"ServicePath="Services\CascadeCombo.asmx"

Enabled="True"ParentControlID="ddState">

</ajaxToolKit:CascadingDropDown>

<ajaxToolKit:CascadingDropDownID="cddHomeDrive"runat="server"TargetControlID="ddHomeDrive"

Category="HomeDrive"LoadingText="[Loading drives...]"PromptText="-Please Select-"

ServiceMethod="GetTechnicalComboValues"ServicePath="Services\CascadeCombo.asmx"

Enabled="True"ParentControlID="ddSuburb">

</ajaxToolKit:CascadingDropDown>

<ajaxToolKit:CascadingDropDownID="cddProfilePath"runat="server"TargetControlID="ddprofilepath"

Category="ProfilePath"LoadingText="[Loading paths...]"PromptText="-Please Select-"

ServiceMethod="GetTechnicalComboValues"ServicePath="Services\CascadeCombo.asmx"

Enabled="True"ParentControlID="ddSuburb">

</ajaxToolKit:CascadingDropDown>

<ajaxToolKit:CascadingDropDownID="cddExchangeServer"runat="server"TargetControlID="ddExchangeServer"

Category="ExchangeServer"LoadingText="[Loading servers...]"PromptText="-Please Select-"

ServiceMethod="GetTechnicalComboValues"ServicePath="Services\CascadeCombo.asmx"

Enabled="True"ParentControlID="ddSuburb">

</ajaxToolKit:CascadingDropDown>

<ajaxToolKit:CascadingDropDownID="cddMailStorageGroup"runat="server"TargetControlID="ddMailStorageGroup"

Category="MailStore"LoadingText="[Loading stores...]"PromptText="-Please Select-"

ServiceMethod="GetTechnicalComboValues"ServicePath="Services\CascadeCombo.asmx"

Enabled="True"ParentControlID="ddExchangeServer">

</ajaxToolKit:CascadingDropDown>

Thanks

Was this ever resolved? I'm having a very similar problem.

Here's my scenario:

cdd1 (top-most)

cdd2 -> parent = 1

cdd3 -> parent = 1

cdd4 -> parent = 1

cdd5 -> parent = 4

Now I get the same problem as you: IE6 unresponsive and later the message "A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?".

Note that I don't have this issue if I remove cdd5 (leaving 1, 2, 3, 4) or if I remove cdd2 (leaving 1, 3, 4, 5) or if I remove cdd3 (leaving 1, 2, 4, 5). So it appears that what's common with your scenario is that if you have three CascadingDropDowns dependent on a given CDD and another CDD dependent on one of the three level2 CDDs, the web page hangs with the above errors.

Thanks for any insight you can give.

-Wayne


Yes I resoved this (by workaround), I apologise for not updating my post.

It comes down to the order the cascading controls appear in the markup (note: not the combo boxes BUT the cascading extenders themselves).

What you need to is to position cdd4 above cdd3 so you end up with this:

cdd1 (top-most)

cdd2 -> parent = 1

cdd4 -> parent = 1

cdd3 -> parent = 1

cdd5 -> parent = 4

As I indicated above the change is only how they appear in the markup. Your cascading relationships and combo boxes themselves dont change. I hope this makes sense.

This sent me crazy... with no replies to my original post it was only by fluke that I discovered this behaviour.

I hope you have success.


Wow! It works.

Thanks very much for the help!

Did you experience any other gotchas using the CascadingDropDownExtender? Initially, I was planning on using standard asp DropDownLists with Ajax UpdatePanels, instead of the CascadingDropDownExtender. However, this is not possible in a FormView if you name your controls the same in both InsertItemTemplate and UpdateItemTemplate. (Here's a post on this problem: http://forums.asp.net/p/1058745/1570069.aspx) I had decided that if I couldn't get the CascadingDropDownExtender to work, I'd just use the UpdatePanels in the template most used for this app. If you know of any other issues with this extender, I'd appreciate finding out. Seems like your scenario might be somewhat similar to mine. I assume you're doing inserts and updates with the dropdowns on which you had the problem?

Thanks again for the help!


The only other problem I had was populating a cascading set via Javascript. There are a number of articles on this but I couldn't get it to work.

The scenario I had was select a State and then select a suburb. The suburb would populate based on the state selected = standard stuff.

I had a copy function that copied these values from another record and I wanted to use Javascript to avoid a postback. I could set the state value but I couldn't set the suburb value.

CascadingDropDown in User Controls

Hi all,

I ran into a problem the other day using CascadingDropDown and I thought I'd share it. It is this:

When using CascadingDropDown within a user control (or a custom control for that matter) you have two options for filling your dropdown list controls:

1. Use a web service method. This apparently (and I could be wrong here) makes it impossible for you to tune your results according to some information stored in the session. So it's fine for "static" data, but not fine for "dynamic" data which may depend on say, the current user.

2. Use a page method. That poses another problem; you don't know on what page your control will run, you can't decouple by using interfaces 'cause the methods the page has to implement need to be static (Shared in VB), so the best I could come up with is define a dummy interface which "reminds" the developer to implement those methods - and of course you need to implement them on every single page you use your user/custom control.

Now both these alternatives are not very appealing. Wouldn't it be better if CascadingDropDown could look in its container for the static methods instead of the Page?

Cheers

In this case,

u can just use normal dropdownlist control make it like cascadingDropDown, then put everything in the updatePanel


I am currently working on a composite control that creates multiple (1-xxx) controls inside of it dynamically (based on XML) one of them being a Cascading Drop Down control.

Once I get it working i'll post here to let you know how I did it.


Hi,

I just posted inanother thread about this issue. I agree it's a problem and think we should try to get it fixed in the Toolkit.

Thanks,
Ted