Wednesday, March 28, 2012

PostBack once all lists in CascadingDropDown are selected

Has anyone found a way to generate a postback once all lists in a CascadingDropDown have a valid selection.

I am converting a web app that has many places where the user has to select Software, Version, Terrain and Course (It's a Virtual Reality Cycling Portal) Previously each selection caused a postback to populate the next list. On each post back the state of the page may need to changed, in terms of different controls being visible to capture either the riders time or the distance they cover.

I have switched to using Atlas and created a UserControl with the CDD to reduce the postbacks, but I still need to change the state of the controls with a postback, as I need to lookup details of the course to determine which controls should be visible.

So what I need to do is generate a postback once all lists have a valid selection. As a last resort I can turn the Ride Upload tool I am referring to into a wizard, but I would prefer to keep the new UI similar to the original single form one users are already using.

The user control is working great in all but this one scenario, as the other scenarios all require the user to click on a button to trigger the update of a data control.

Once the last CDD gets a selection, you know that all the CDDs have a selection - might you be able to tag the last CDD with AutoPostBack? Alternatively, maybe you could write a little bit of JS to run on the client side and hook the onchange event of the DDL and do the postback manually?

No comments:

Post a Comment