custom-error-pages

ASP.NET MVC HandleError

How do I go about the [HandleError] filter in asp.net MVC Preview 5? I set the customErrors in my Web.config file <customErrors mode="On" defaultRedirect="Error.aspx"> <error statusCode="403" redirect="NoAccess.htm"/> <error statusCode="404" redirect="FileNotFound.htm"/> </customErrors> and put [HandleError] above my Controller Cl...

What are the 404;1, 404;2 etc HTTP error codes for?

In IIS I can configure my custom error pages. For each HTTP Error code I can say where to go. Several codes have a number of "sub" codes available. For example 404 has a regular 404, 404;1, 404;2 and so on.. What are they for? When are they returned? Should I make custom pages for these errors? Can I somehow easely configure all code "f...

Custom error page configured in IIS for code 400 (bad request) is ignored

For my website I configured some custom error pages. If I generate a 404, the redirect works fine. When hitting a 400, the "bad request" text shows up instead of the configured URl. As a test I copied the URL from 404 to 400. No change. Then I changed the redirect to a file. No change. Any ideas? ...

ASP.NET custom error page - Server.GetLastError() is null

I have a custom error page set up for my application: <customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx" /> In Global.asax, Application_Error(), the following code works to get the exception details: Exception ex = Server.GetLastError(); if (ex != null) { if (ex.GetBaseException() != null) ...

Is it okay to extend a base view in Django's error pages (HTTP 404 and 500)?

Django's views documentation states that "the default 500 view passes no variables to this template and is rendered with an empty Context to lessen the chance of additional errors," but is it okay to use the {% extends %} tag to re-use a base view in the 500 Server Error page (500.html)? ...

asp.net custom error page and file without extension

How can i get IIS 7 to return my custom error pages for file without extension? I got it working for file with extension, but when the extension is not specified, i get the generic page. ...

Safari browser won't display Error 401 page.

I'm using Apache 2 and have a custom 401 page, in httpd.conf ErrorDocument 401 /error/unauthorized.html When I access a protected resource, all browsers show the basic http authentication dialog. If I click "cancel", all browsers but Safari (v3 and v4) will display the custom 401 page. Safari just displays the current page. Is there ...

How to get the message in a custom error page (Tomcat)?

In JSPs, you may use response.sendError(int code, String message) to return a particular error code (eg 404 for not found) and a message as well. These messages display fine, as long as you use the default ugly Tomcat error pages. However, if you create a custom error page, how do you get that message? I've tried exception.getMessage() ...

Display different Tomcat error pages depending on URL of original request

I would like to use Tomcat's error-page directive to display various different error pages in response to various types of exceptions. However, I want the error page displayed to have different styling and content depending on the original request URL that resulted in the error. Specifically, I have an admin part of my web application,...

Proper Exception Handling with ASP.NET MVC, ELMAH and custom Error Pages

Hi folks, consider the following situation: There is an ASP.NET MVC application which utilizes ELMAH for centralized ExceptionLogging. A Controller is marked with the HandlerError Attribute to catch a specific type of an exception and presents the user with a view. For example [HandleError(ExceptionType = typeof(ModelSpecificException...

Custom Errors not Forwarding on ASP.NET MVC Site

On my site, a broken link throws the default, page not found error. In the web.config I have turned on CustomErrors and forward 404 errors to a custom message. On my dev box it works, on the host it does not. Any ideas? ASP.NET MVC 1.0, SQL 2005, IIS 6 host (ya, I wish it was IIS7 - but they want to charge me to move the site). Thanks...

How to use another error page instead of Error.aspx in ASP.NET MVC?

Hi, I have AdminError.aspx and Error.aspx pages and I want to display AdminError.aspx when there is an exception. I need both files. Why this doesn't work? <customErrors mode="On" redirectMode="ResponseRedirect" defaultRedirect="AdminError.aspx" /> Instead Error.aspx is always displayed. What can I do? ...

Returning Requested URL within Custom Error Page in ASP.net

Working in ASP.net 3.5 and MVC 1.0. What I would like to do is return the requested URL, which generates a 404 error, within the custom error page. Much like Google does on their error pages (http://www.google.com/test). eg. We're sorry, but the requested address "http://www.domain.com/nonexistantpage.aspx" does not exist on this serv...

Custom error 404 - bypassed in specific case

I have a question regarding HTTP 404 error handling by IIS. I know that this is a subject discussed very much but still i cannot find the answer. I have my custom page NotFound404.aspx and works just fine. On page not found the my url is */NotFound404.aspx?aspxerrorpath=/index_fake.aspx* My question is: what happens if i edit this URL ...

Get long descriptions of http status codes in asp.net (IIS7)

I've set up a custom error page to handle errors thrown through my site. I'm running asp.net 3.5 with IIS 7.0 on Godaddy shared hosting ("deluxe" account). Normally, if I set Response.StatusCode = 412 the server outputs: Server Error 412 - Precondition set by the client failed when evaluated on the Web server. The request was not comp...

ELMAH - Using custom error pages to collecting user feedback

Hey guys I'm looking at using ELMAH for the first time but have a requirement that needs to be met that I'm not sure how to go about achieving... Basically, I am going to configure ELMAH to work under asp.net MVC and get it to log errors to the database when they occur. On top of this I be using customErrors to direct the user to a fri...

Implementing a Custom Error page on an ASP.Net website.

I have an ASP.Net website and I want to use a custom error page. I put the following code in my web.config <customErrors mode="On" defaultRedirect="~/error.aspx"> <error statusCode="404" redirect="~/error.aspx" /> </customErrors> The problem is when i go to a URL that does not exist is still uses the 404 error page specified in II...

Does processModel/serverErrorMessageFile work when accidentally mixing ASP.NET versions in IIS6?

I've tried setting serverErrorMessageFile to a path relative to machine.config, and to an absolute path, but when accessing an app on our IIS6 server that shares a pool with another ASP.NET version, we still get the big, ugly, red, default Server Application Unavailable message. Since one of our ASP.NET apps recently (and mysteriously) ...

A funny idea for 404 pages ?

I need a funny idea/inspiration for my 404 pages it can be a picture or funny dialog. ...

Custom 404 not found page in iis 7 for Classic ASP

Hello, I installed windows 2008 server integrated iis 7.0 1 day ago, i use windows 2003 and iis 6.0 with windows 2008 server, everything is alright except one thing. in 2003-iis6 i could use custom 404 pages to handle for url friendly sites. example i could set custom404.asp as custom 404 pages(execute url) in 2008, i can't do it. w...