Rahul Chowdhury
Rahul Chowdhury

Reputation: 1158

Response.Redirect from a page inside a folder of web solution?

In my solution i have a folder FIRE in which i have a page.I am using respose.redirect to handle my error to another page Error.aspx. I am writing

catch (System.Exception ex)
{
    //DisplayError(ex);
    Session["ExceptionDetails"] = ex;
    Response.Redirect("ErrorInformationDetails.aspx");
}

but getting error

resource not found /FIRE/ERROR.aspx not found.

but for other pages which are in main directory its working fine

Upvotes: 0

Views: 3944

Answers (3)

Neeraj
Neeraj

Reputation: 4489

Try This code.This Can reduce a RoundTrip Process of Web Request if cursor goes to Exception Block.

Response.RedirectPermanent("~/Administration/Masters/SearchThought.aspx");

Upvotes: 1

Robin Joseph
Robin Joseph

Reputation: 1325

try this

Response.Redirect("~/Fire/Error.aspx");

Upvotes: 2

KV Prajapati
KV Prajapati

Reputation: 94643

Always use root operator (~) to avoid such errors:

Response.Redirect("~/Fire/Error.appx");

Upvotes: 2

Related Questions