J
John
Hi all,
I have posted this type of question quite a few times but to date, no-one
has actually been able to provide me with a solution. I really need to
understand how to do this properly.
My situation:
I have n user controls which, based on user input, interchange with a
placeholder on a web form.
My problem:
Using the LoadControl function, my dynamic user controls are not maintaining
their state upon the first postback. If the same control is being loaded the
2nd time, then the viewstate is fine.
I understand that I need to re-load the user controls (i.e. LoadControl)
upon a postback to obtain the correct viewstate so as to get to the values
the user entered from the screen. I cannot simply paste the user controls
onto the webform and then set the visibility based on a variable because
there are just too many user controls.
Please could someone help me with this so I can understand it clearly and
move on to other exciting .NET-related things. I really need closure on
this. . .
Regards
John.
I have posted this type of question quite a few times but to date, no-one
has actually been able to provide me with a solution. I really need to
understand how to do this properly.
My situation:
I have n user controls which, based on user input, interchange with a
placeholder on a web form.
My problem:
Using the LoadControl function, my dynamic user controls are not maintaining
their state upon the first postback. If the same control is being loaded the
2nd time, then the viewstate is fine.
I understand that I need to re-load the user controls (i.e. LoadControl)
upon a postback to obtain the correct viewstate so as to get to the values
the user entered from the screen. I cannot simply paste the user controls
onto the webform and then set the visibility based on a variable because
there are just too many user controls.
Please could someone help me with this so I can understand it clearly and
move on to other exciting .NET-related things. I really need closure on
this. . .
Regards
John.