im not sure i understand your question 100% but you might be able to use the IsPostBack value to determine if you are indeed in a postback state, in which case you can set the cascading drop down settings that you want.
if(IsPostBack)
{
do something to cascading drop down
}
just put that in the page_load function and the code inside will run everytime there is a post back
That won't work. If you did something like this:
if(IsPostBack)
{
CCD1.Enabled = false;
}
then when the page reloaded, the CascadingDropDown would not be rendered, and if the user then selected a different value in the first DropDown, it would no longer cascade to the second one.
What I am trying now is to put the validation triggers (the submit button, etc) in an UpdatePanel, which will cause the Cascading controls to remain unchanged. The problem with that is that when the page posts back, the ValidationSummary does not display error messages. If you then put the ValidationSummary in an UpdatePanel, it no longer displays error messages on client validation LOL
Anyway, I'm still playing around with it.
Thanks,
Carl
Okay, I've come up with a solution. I don't know if it is the best one, but it works.
I put the cascaded controls in conditional UpdatePanels. I put the submit button also in a conditional UpdatePanel. I put the ValidationSummary controls in "always" UpdatePanels. Now everything works; when I postback, the Page.IsValid() test updates all the controls with asterisks and the ValidationSummary controls display the error messages, but the conditional dropdownlist control stays put. All client functionality continues to work just fine.
No comments:
Post a Comment