如何阻止母版页加载子页的每个事件? [英] how to stop masterpage being load each and every event of child page?

查看:90
本文介绍了如何阻止母版页加载子页的每个事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的asp.net Web应用程序中,每次在加载子页面或触发某个子页面事件时,都会每次都加载母版页面.问题在于,当执行任何事件时,母版页加载事件都会调用,并且母版页的每种方法都会一次又一次地加载.因此发生了不必要的往返行程,任何事件都需要花费很长时间才能执行.这就是为什么我的应用程序变慢的原因. 请帮我...

在此先感谢....

hi to all,

In my asp.net web application the master page is being loaded each and every-time when child page is loading or some event of child page is fired. The problem is that when any event is performed, the master page load event calls and every method of master page is loading again and again. So unnecessary round trips happens and any event is taking a long time to perform. Thats why my application gets slow.
please help me...

thanks in advance....

推荐答案

所有母版页内步调方法
All the method of master page pace inside
if(!IsPostback)
{
//All the method which you don't want to execute.
}


母版页的方法将首次执行,而不是内部执行.


For the 1st time the methods of master page will execute than it will not go inside than.


这篇关于如何阻止母版页加载子页的每个事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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