 |
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
|
|
|
|
|

November 5th, 2015, 01:03 AM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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?
|
|

November 6th, 2015, 05:08 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> 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
|
|

November 6th, 2015, 06:19 AM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Is this a topic beyond the content of the book or can I use FriendlyUrl's for this?
Thanks
|
|

November 7th, 2015, 05:22 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

November 7th, 2015, 07:11 PM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Not at all, only that I wanted to redirect to the custom error page even is the user forgot the extension .aspx
Thanks.
|
|

November 8th, 2015, 04:59 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

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

November 9th, 2015, 04:32 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
|
|

November 9th, 2015, 04:43 PM
|
|
Authorized User
|
|
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Ok. I'll take a look at those links.
Thanks.
|
|
 |
|