简体   繁体   English

使用Response.Redirect()时不会触发Page_Load事件

[英]Page_Load event not firing when using Response.Redirect()

I have two forms in my web application (Page1 and Page2). 我的Web应用程序中有两种形式(Page1和Page2)。 Now Page1 is having a grid on whose row_command event i am going to Page2. 现在,Page1上有一个网格,我将在该网格上进入Row2命令。 And on load event of Page2 i am checking a condition which if false i am going to Page1 using Response.Redirect(). 在Page2的加载事件上,我正在检查一个条件,如果为假,我将使用Response.Redirect()进入Page1。

Now when i am going from Page2 to Page1 the load event of Page1 is not getting fired. 现在,当我从Page2转到Page1时,不会触发Page1的加载事件。 i have used cache clearing and response.end ,but its not helping. 我已经使用缓存清除和response.end,但没有帮助。 But when i am using Server.Transfer the load event of Page1 is getting fired. 但是,当我使用Server.Transfer时,将触发Page1的加载事件。

Awaiting for ur response .Guys 等待您的回应。

It should get called during Response.Redirect. 它应该在Response.Redirect期间被调用。 Make sure there is no IsPostBack checks anywhere in the page load. 确保页面加载的任何地方都没有IsPostBack检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM