内容页面刷新而无需母版页回发 [英] Content page refresh without master page postback

查看:75
本文介绍了内容页面刷新而无需母版页回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在一个网站上,您能告诉我如何在内容区域中加载新页面吗?当我单击左侧菜单项时,不回发母版页(整个页面),该如何编写代码.请告诉我.提前谢谢.

问候
Murty

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

推荐答案

您期望的行为并不完全是母版页的工作方式.在这种情况下,可能有多种方法可以实现无回发解决方案,但最简单的方法是使用< IFrame/> (通常会皱眉)

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)

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.





方法2:





Method 2:

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)"/>

我正在使用它,但是它不起作用.
<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.


这篇关于内容页面刷新而无需母版页回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆