trnTash
trnTash

Reputation: 307

Server.Transfer does not work?

I want to redirect to another page using Server.Transfer and I have this simple 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.

Upvotes: 0

Views: 2735

Answers (1)

Guido Domenici
Guido Domenici

Reputation: 5246

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.

Upvotes: 1

Related Questions