W
wfsmith
I have a page with a MultiView control and 6 Views. Each view has a
User control that contains various form controls (dropdowns, textboxes
and CascadingDropDown Ajax.Net controls).
When the page is loaded, I populate the various form controls with
data inside each of the 6 Views by accessing my exposed properties of
my User Control.
All the controls persist during postback, and any changes I make also
persist during postbacks, but the same cannot be said for the
CascadingDropDown control. It seems these controls do not interact
with the Viewstate such that when I change my active view (i.e.
Postback), the CDD controls on all the views revert to their default
values and the SelectedValues are gone.
I thought I had a working solution by saving the values to hidden
textbox controls and then setting the CDD SelectedValue to each
textbox control in the Page_Load of my User Control. The problem
with this is that any changes you make are lost when you change the
Active View.
Control hierarchy im using:
MasterPage
Edit page
MultiView
View
User Control
Textbox controls
...many other controls....
CascadingDropDown controls
So when the Edit Page loads, I bind the data to the exposed properties
of my User Control. All work great, and persist during postback,
except for CascasdingDropDown which loses its SelectedValue when the
Active View is changed (because that causes a post back).
Perhaps im going about this wrong? Should I use update panels and
skip the MultiView? Ive read about this being similar to Custom
controls and that I need to programmatically create my CDD controls in
Page_Init (or something like that).
Any help is greatly appreciated.
User control that contains various form controls (dropdowns, textboxes
and CascadingDropDown Ajax.Net controls).
When the page is loaded, I populate the various form controls with
data inside each of the 6 Views by accessing my exposed properties of
my User Control.
All the controls persist during postback, and any changes I make also
persist during postbacks, but the same cannot be said for the
CascadingDropDown control. It seems these controls do not interact
with the Viewstate such that when I change my active view (i.e.
Postback), the CDD controls on all the views revert to their default
values and the SelectedValues are gone.
I thought I had a working solution by saving the values to hidden
textbox controls and then setting the CDD SelectedValue to each
textbox control in the Page_Load of my User Control. The problem
with this is that any changes you make are lost when you change the
Active View.
Control hierarchy im using:
MasterPage
Edit page
MultiView
View
User Control
Textbox controls
...many other controls....
CascadingDropDown controls
So when the Edit Page loads, I bind the data to the exposed properties
of my User Control. All work great, and persist during postback,
except for CascasdingDropDown which loses its SelectedValue when the
Active View is changed (because that causes a post back).
Perhaps im going about this wrong? Should I use update panels and
skip the MultiView? Ive read about this being similar to Custom
controls and that I need to programmatically create my CDD controls in
Page_Init (or something like that).
Any help is greatly appreciated.