Master page question

  • Thread starter Thread starter Vincenzo Milazzo
  • Start date Start date
V

Vincenzo Milazzo

Hi

Is it possible switch between conten page programmatically without lose the
control's state in the master page ?
 
Is it possible switch between conten page programmatically without lose
the control's state in the master page ?

MasterPages don't work like framesets - they are UserControls.

To change the content, you simply redirect to another content page.
 
The concept of master-content pages is not like frames where you have a page
made out of two different parts and you can replace one part in runtime
while keeping the other. Master and content pages rather make up one single
page. If you need another content, you need to switch to another page. It
doesn't mean you can't keep the control state from the first page. You just
need to persist it in a regular way, e.g. in session variables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
ok, thanks for reply.

insted of session, already I had thought, is it possible to use ajax with
master page to solve my problem ?

Eliyahu Goldin said:
The concept of master-content pages is not like frames where you have a
page made out of two different parts and you can replace one part in
runtime while keeping the other. Master and content pages rather make up
one single page. If you need another content, you need to switch to
another page. It doesn't mean you can't keep the control state from the
first page. You just need to persist it in a regular way, e.g. in session
variables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Vincenzo Milazzo said:
Hi

Is it possible switch between conten page programmatically without lose
the control's state in the master page ?
 
insted of session, already I had thought, is it possible to use ajax with
master page to solve my problem ?

Probably. Ajax uses callbacks instead of postbacks, so if your content page
only initiates callbacks, then the entire page will not get rerendered every
time - therefore, any state you preserve in your MasterPage will remain...
 
Back
Top