为什么 page_load 在我的 Web 应用程序中被调用两次?
我已经浏览过许多网站上关于 page_load 被调用两次的一些帖子,但我的问题与那些有点不同。
我的问题是我的网络应用程序的登陆页面。
最初在我的网站中,每次加载登陆页面时,page_load都会被调用两次。由于我的应用程序是升级版的(从 VS 2003 到 VS 2005/2008),我在 InitializeComponent 中注释了“this.load”事件。现在,当用户首次登录我的网络应用程序时,它工作正常。但是,每当用户从应用程序中的任何其他页面导航到此页面时,page_load 都会被调用两次。
有谁知道为什么会发生这种情况。我尝试跟踪此调用堆栈,但 VS 2008 显示这是从外部代码调用的。
另外,我在我的网络应用程序中使用框架。我想知道这个问题是否与框架有关。
非常感谢任何帮助。
问候,
哈里
I have already gone through some of the posts in many websites regarding page_load being called twice but my problem is little bit different from those.
My problem is with the landing page of my web application.
Initially in my website page_load for the landing page was getting called twice every time when it is loaded. Since my application is an upgraded one (from VS 2003 to VS 2005/2008), I commented the "this.load" event in InitializeComponent. Now it works fine, when user first logs in, into my web application. But then, whenever user navigates to this page from any other page in my application, page_load gets called twice.
Does anybody have any idea about why this could be happening. I tried to track the call stack for this, but VS 2008 was showing that this was getting called from external code.
Also, I am using frames in my web application. I wonder if this problem has anything to do with frames.
Any help is deeply appreciated.
Regards,
Hari
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论