View Full Version : how to call default 404 error page in asp
01-20-2005, 04:36 AM
I want to call the default 404 error page in my asp.In my program if their is any error occured I want to display the default error page,so can any of you please say how to call the default 404 error html page in asp.
Thanks in advance
01-20-2005, 06:01 AM
In IIS, go to Default Web Site Property dialog box, Custom Errors Tab, look for 404 and then edit it to set new HTML file to use.
02-04-2005, 12:20 PM
Is there a way that the same thing can be achieved when u r coding on an ASP server and don't have that kinda flexibility?
02-04-2005, 01:14 PM
yes it's very easy :-)
on error resume next
run any code here
If Err.Number <> 0 then
as far as this page doesn't exist you'll get a wonderfull 404 error
02-04-2005, 03:11 PM
if error then
response.status = "404 Not Found"
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.