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:




aperture8 July 29th, 2012 12:59 AM

Imar rules!

All times are GMT -4. The time now is 09:27 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.