Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Master page refreshing while navigating between pages?

I'm using Master Page in my ASP.net application, in the master page I put a ContentPlaceHolder in Update Panel to support AJAX in child pages, the question is how to stop Refreshing "master page controls" while navigating between pages?

For navigation between pages I tried to use Response.Redirect, windows.location java script with no success, shall I use the Frames or IFrames instead of Master Pages to stop Refreshing?

any suggestion to solve this issue will be highly appreciated, Thanks in advance...

like image 385
Wael Dalloul Avatar asked Apr 21 '10 07:04

Wael Dalloul


1 Answers

If you don't want the page to refresh when switching between "pages", you will not have any good solution using master page. As others have said in different words, the master page is just a common "template" that is used by different pages. The navigation between is just like calling different pages, and of course will reload the entire page, including the master page content.

  1. A sollution I have used with Ajax is to have each "page" as a user controls, and put them all in an UpdatePanel with visible="false". Then for navigation between "pages", switch visibility for the user controls to show the right "page" control.

  2. The alternative is to use iframe.

Neither of these solutions use MasterPage.

The MasterPage concept was designed to simplify a common look before Ajax was introduced in ASP.NET. After Ajax became popular, the demand for not refreshing the entire page has been more common.

like image 95
awe Avatar answered Nov 16 '22 03:11

awe