开发者

Server.Transfer does not work?

开发者 https://www.devze.com 2022-12-29 17:18 出处:网络
I want to redirect to another page using Server.Transfer and I have this sim开发者_如何学Pythonple code:

I want to redirect to another page using Server.Transfer and I have this sim开发者_如何学Pythonple code:

if (Page.IsPostBack)
   {
     try
     {
       Server.Transfer("AnotherPage.aspx");
     }
     catch (Exception)
     {                                
       throw ;
     }
    }

But I'm getting an error: "Error executing child request for AnotherPage.aspx.". Could not find the solution on the net.

Just to mention, Response.Redirect works flawlessly.


The error is likely caused by something in AnotherPage.aspx. You may want to insert a try... catch handler in AnotherPage.aspx's Load event.

0

精彩评论

暂无评论...
验证码 换一张
取 消