Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2011, 10:43 AM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default Custom Error Pages

I created a couple of error pages, one general and another to catch the page not found 404 error - ~/Errors/Error.aspx & Error404.aspx then added the relevant element in Web.config:

<system.web>
<customErrors mode="On" defaultRedirect="~/Errors/Error.aspx" redirectMode="ResponseRewrite">
<error statusCode="404" redirect="~/Errors/Error404.aspx"/>
</customErrors>
....

But in testing my 404 error page doesnt come up when I try to navigate to an incorrect page, have I missed somthing here?
 
Old July 27th, 2011, 02:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you request the full URL of the error page in the browser directly?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 28th, 2011, 03:33 AM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes
 
Old July 28th, 2011, 04:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In that case you need to supply more information. Where do you see this problem? In IIS? In the local development server? Have you tried to use Fiddler and see what status code it gives you?

And what do you see when you request a non-existing page?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Validation and Master Pages conflict tedmasterweb BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 February 2nd, 2009 10:22 AM
Error in "Try It Out", pages 149-150 pfloyd BOOK: Beginning XML 3rd Edition 0 December 18th, 2007 10:53 AM
Get 500 error on all .asp pages. RubberDuck Classic ASP Basics 4 November 22nd, 2004 02:39 AM
loading pages with custom size, toolbars etc dunc Javascript How-To 6 August 18th, 2004 04:37 PM
Provider error in p2p pages. happygv Forum and Wrox.com Feedback 2 August 13th, 2004 06:16 PM





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