Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 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 November 5th, 2015, 01:03 AM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default Ch 18, p679 - No 404

Hi Imar,

I confused which <system.web> to put <customErrors> because there are more than one <system.web> in Web.config.

That's why I received always the generic 404 page and not the customized.
I even check for the common mistakes until I check your source code.

The right <system.web> is the first <system.web> as a child of <configuration> with no other element as a parent, but I didn't understand that way when I read the step 5.


Thanks, and hope it helps other 'beginners' or even 'Pro's'.


PS: If I forgot the .aspx to the testpage, the generic page will display. Any method to get this work even without extension?
 
Old November 6th, 2015, 05:08 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> PS: If I forgot the .aspx to the testpage, the generic page will display. Any method to get this work even without extension?

No, you need the extension since the rewrite happens without the friendly URL module kicking in.

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 November 6th, 2015, 06:19 AM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Is this a topic beyond the content of the book or can I use FriendlyUrl's for this?

Thanks
 
Old November 7th, 2015, 05:22 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Like I said, you need the extension since the rewrite happens without the friendly URL module kicking in.

But why is this a problem? If you use rewrite, you'll never see the extension.

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 November 7th, 2015, 07:11 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Not at all, only that I wanted to redirect to the custom error page even is the user forgot the extension .aspx

Thanks.
 
Old November 8th, 2015, 04:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Do you mean the user browsing to a page? Or the user configuring the error settings in web.config?

In the latter case, you may need runAllManagedModulesForAllRequests:https://www.google.com/?gws_rd=ssl#q...ForAllRequests

Cheers,

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 November 8th, 2015, 07:21 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Well, what I meant was that you said on p.679, step 12 to use DefaultTest.aspx, then it'd show the custom page; yes, it worked. Now, I tested it without typing the extension. The generic page popped out. I wanted to redirect even is I didn't type .aspx to the custom page.

Thanks.
 
Old November 9th, 2015, 04:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Take a look here:

http://forums.iis.net/t/1200695.aspx
https://www.google.com/?gws_rd=ssl#q...nsion+less+404

Cheers,

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 November 9th, 2015, 04:43 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Ok. I'll take a look at those links.

Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch. 18-4 IE7 solution?? ccreed50 BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 January 9th, 2007 08:35 PM
can't get messagebox example in ch 18 to work itlotl VB.NET 2002/2003 Basics 3 January 13th, 2006 04:39 PM
Ch. 18 Exercise 1, is there a change? horseatingweeds BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 4 November 29th, 2005 05:33 PM
Ch. 18, page 636 Vera BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 March 18th, 2005 06:09 PM
Problems with Ch. 18 example tomephillips BOOK: Beginning ASP 3.0 5 November 6th, 2003 08:25 AM





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