0

I redirect Errors to Error.aspx

 <system.web>
        <customErrors defaultRedirect="error.aspx" mode="On">
        <error redirect="error.aspx" statusCode="500" />
 </system.web>

and the problem is that there is also second error in ErrorMasterPage of Error.aspx

<script Language="C#" MasterPageFile="~/ErrorMaster.Master" runat="Server">

and CustomError can not handle the second error while its like a loop ( it will redirect to error.aspx and Masterpage of Error.aspx has Error.

here is problem:

Example:

Login.aspx(has Error) -> Error.aspx -> ErrorMasterPage.Master (has Error) -> Show Yellow Page Thanks

7
  • You should fix the error in your error page. What else would you do in that situation? Commented Dec 22, 2010 at 13:58
  • I do not see any question or anything wrong in your post ... Commented Dec 22, 2010 at 14:08
  • @Frédéric : the error is in Masterpageof Error and is not in Error.aspx Commented Dec 22, 2010 at 14:08
  • @Madhur , I added an Example to Post Commented Dec 22, 2010 at 14:10
  • @Reza - The error page should be as free of possible errors as you can make it. It should not necessarily rely on a master page, and if it does, that master page should be certified error free before it is viable. Commented Dec 22, 2010 at 14:13

1 Answer 1

1

If you're doing automatic redirection using web.config I'd say you should have an error page so simple that almost no server error is possible. If you're accessing the database on that page, you would enter on a loop if the error is related with that.

Another option would be redirecting to the error page using the error handler on global.asax. This would involve C# logic. There, you could detect if the error was generated on error.aspx and on that case, you could redirect to fatalerror.aspx (a white page just showing a message for instance).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.