loadcontrol

S

sunil

Will the state of a dynamically loaded control preserved in transitions
between aspx pages hosting the control.?
thanks
 
S

sunil

HrtgSkr, here is the situation. All web pages have header and footers which
are user controls. Iam loading
these controls in base class of my page using LoadControl. Will the state of
these dynamically loaded control
preserved between transitions in pages. For e.g Will the tree control in the
header preserver its state when i
navigate to a different web-pages?

I hope iam clear now.
Appreciate your response.
thanks
 
D

Dawn Baker

The values in the usercontrol properties will not persist. I have
noticed, that the webcontrols inside my usercontrol hold their viewstate
as long as I stay on the parent page. My usercontrol isn't loaded with
loadcontrol, though, so even though it's not visible, it's still "an
instance".

If you're using serialization, you can store the information you need
from the usercontrol in ViewState. There's many ways to preserve the
values. I've just learned through trial and error to start simple, then
build on it, setting breakpoints and using Autos and Watch tabs to see
the state of my variables as I move through the pages.

Do you need to load them dynamically? Can you just modify them to
adjust for each parent page?

Dawn.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top