p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=560)
-   -   The custom 404 error page does not seem to work (http://p2p.wrox.com/showthread.php?t=87973)

aperture8 July 11th, 2012 08:47 PM

The custom 404 error page does not seem to work
 
Hi Imar,

When you include this in the custom Http 404 error page,

protected void Page_Load(object sender, EventArgs e)
{
Response.Status = “404 Not Found”;
Response.StatusCode = 404;
}



the custom page itself cannot be found and loaded to browser. Could this be a bug? Thanks.

Imar July 16th, 2012 05:13 AM

Hi there,

This is IIS 7 or later taking over the error pages. You can stop that from happening by setting:

Response.TrySkipIisCustomErrors = true;

in the Code Behind as well.

For more details:

http://stackoverflow.com/questions/4...nse-statuscode
http://www.west-wind.com/weblog/post...ver-500-Errors

Cheers,

Imar

aperture8 July 29th, 2012 12:59 AM

Imar rules!


All times are GMT -4. The time now is 04:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.