Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dealing with 404.0 subStatusCode's within the Web.config?

Reply
Thread Tools

Dealing with 404.0 subStatusCode's within the Web.config?

 
 
none
Guest
Posts: n/a
 
      07-18-2008
All,
I was wondering is their a way of dealing with subStatusCode's with in the
webconfig file? I unfortunately don't have access to anything other then
webconfig and qould perfer to set in code rater then my webhost's control
panel.

I've even tried:

<customErrors mode="On" defaultRedirect="/pages/error.aspx" />

aspx pages are handled but but I still have a problem if the user types in
..asp .htm etc by mistake. Thanks in advance. - CES

 
Reply With Quote
 
 
 
 
George
Guest
Posts: n/a
 
      07-18-2008
As of right now you can not...

Problem is that web.config only kicks in when ASP.NET engine is called by
IIS. And ASP.NET engine is called only when extension (such as .aspx, .asmx,
....) associated with ASP.NET is requested.

So solution is
Associate all extensions with ASP.NET but be careful cause then my.gif will
be redirected to ASP.NET instead of sending image to the browser
Or you can make custom 404 page with .aspx extension (for example
missing.aspx) . Then IIS will redirect for any 404 request to missing.aspx
and ASP.NET will kick in and you can do anything you want. But be careful
again since any missing.gif will be redirected to ASP.NET then.

George.




"none" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> All,
> I was wondering is their a way of dealing with subStatusCode's with in the
> webconfig file? I unfortunately don't have access to anything other then
> webconfig and qould perfer to set in code rater then my webhost's control
> panel.
>
> I've even tried:
>
> <customErrors mode="On" defaultRedirect="/pages/error.aspx" />
>
> aspx pages are handled but but I still have a problem if the user types in
> .asp .htm etc by mistake. Thanks in advance. - CES


 
Reply With Quote
 
 
 
 
Steven Cheng [MSFT]
Guest
Posts: n/a
 
      07-21-2008
I agree with George,

For the case that user types an incorrect url(invalid one), the ASP.NET
custom error section will not be able to catch that. It is not due to
ASP.NET doesn't take care of it, but it doesn't even have a chance to get
notice of such kind of error. This type of error is at first chance
detected and handled by the webserver(such as IIS) and ASP.NET runtime
doesn't even have idea that such kind of error ever happened.

If you need to handle all such kind of errors, it is necessary to configure
the IIS metabase for to customize the custom error setting of virtual
directory.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
http://www.velocityreviews.com/forums/(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "George" <(E-Mail Removed)>
>References: <(E-Mail Removed)>
>In-Reply-To: <(E-Mail Removed)>
>Subject: Re: Dealing with 404.0 subStatusCode's within the Web.config?
>Date: Fri, 18 Jul 2008 19:59:50 -0400


>As of right now you can not...
>
>Problem is that web.config only kicks in when ASP.NET engine is called by
>IIS. And ASP.NET engine is called only when extension (such as .aspx,

..asmx,
>...) associated with ASP.NET is requested.
>
>So solution is
>Associate all extensions with ASP.NET but be careful cause then my.gif

will
>be redirected to ASP.NET instead of sending image to the browser
>Or you can make custom 404 page with .aspx extension (for example
>missing.aspx) . Then IIS will redirect for any 404 request to missing.aspx
>and ASP.NET will kick in and you can do anything you want. But be careful
>again since any missing.gif will be redirected to ASP.NET then.
>
>George.
>
>
>
>
>"none" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> All,
>> I was wondering is their a way of dealing with subStatusCode's with in

the
>> webconfig file? I unfortunately don't have access to anything other then
>> webconfig and qould perfer to set in code rater then my webhost's

control
>> panel.
>>
>> I've even tried:
>>
>> <customErrors mode="On" defaultRedirect="/pages/error.aspx" />
>>
>> aspx pages are handled but but I still have a problem if the user types

in
>> .asp .htm etc by mistake. Thanks in advance. - CES

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dealing with nested xml within nested xml within...... Ultrus Python 3 07-09-2007 09:00 PM
GetElementbyID question - within MasterPage/contentpage - within tables Elmo Watson ASP .Net 1 05-08-2007 05:12 PM
How do I include a server tag within a javascript parameter which is itself within a HTML element event? mark4asp ASP .Net 2 11-07-2006 06:23 AM
Referring to a textbox within a web control within an aspx KatB ASP .Net 0 04-22-2005 07:14 PM
search within a search within a search - looking for better way...my script times out Abby Lee ASP General 5 08-02-2004 04:01 PM



Advertisments