Click here to Skip to main content
15,302,859 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am doing one website, can you please tell me how to load a new page in the content area, when i click in the left menu item, without postback the master page(whole page), how to write the code. Please let me know. Thanks in advance.

Regards
Murty
Posted

Your expected behavior is not exactly how master pages work. There may be ways to achieve a no postback solution in this scenario but the easiest one would be to use an <IFrame /> (which is usually frowned upon)

CSS
explanation:

ASP.NET engine takes your aspx and puts it inside the master page and then renders it as one page, then serves it to user.

If this is not what you want and you want that only content of your master page be loaded, then you should not use master pages at all! It's against nature of master pages. they act like skins for aspx pages.

Search for HTML IFrame tag and don't use master page.

P.S: IFrames are not used widely in this days.




Method 2:

XML
In order to Avoid Master Page Postback i.e only to refresh the content within  ContentPlaceholder, we need to do is add following two lines in the <head> tag of the MasterPage.

<meta http-equiv ="Page-Enter" content ="blendTrans(Duration=0)"/>

<meta http-equiv="Page-Exit"content="blendTrans(Duration=0)"/>
   
<meta http-equiv ="Page-Enter" content ="blendTrans(Duration=0)"/>

<meta http-equiv="Page-Exit"content="blendTrans(Duration=0)"/>
hi
i am using this but it does not work.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900