IT Community - Software Programming, Web Development and Technical Support

How to catch the 404 error in my web application IN ASP.NET?

This is a discussion on How to catch the 404 error in my web application IN ASP.NET? within the ASP and ASP.NET Programming forums, part of the Web Development category; How to catch the 404 error in my web application IN ASP.NET?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-26-2007, 01:04 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Question How to catch the 404 error in my web application IN ASP.NET?

How to catch the 404 error in my web application IN ASP.NET?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-26-2007, 01:05 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: How to catch the 404 error in my web application IN ASP.NET?

In the global.asax Application_error Event write the following code
(ex.GetType() == typeof(System.IO.FileNotFoundException))
{
//your code
Response.Redirect ("err404.aspx");
}
else
{
//your code
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Catch Paste Event in Javascript velhari HTML, CSS and Javascript Coding Techniques 0 12-04-2007 06:33 AM
Server Error in '/appname' Application. KiruthikaSambandam ASP and ASP.NET Programming 1 08-25-2007 02:34 AM
What is TRY/CATCH block in T-SQL? oxygen Database Support 1 07-26-2007 04:19 AM
How I can catch command event in j2me? bluesky J2ME 1 07-25-2007 05:58 AM
Why is it not advisable to catch type “Exception”? theone Java Programming 1 07-24-2007 04:06 AM


All times are GMT -7. The time now is 08:30 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0