Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
How do you set a 404 page?
Old 09-03-2007, 06:00 PM How do you set a 404 page?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Say I want to make ~/404.aspx into my not found page. How do I actually make this happen? I've tried using web.config and by setting custom errors in IIS management snap-in for MMC. But neither works.

I don't think the answer changes if it's old or new ASP. How you code the page is different, but how you make IIS use the page instead of its generic error message is probably the same?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-03-2007, 07:14 PM Re: How do you set a 404 page?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
The IIS management console should have worked, but the key is to set it to URL and NOT File.

It's worked every time for me in the past.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 09-03-2007, 07:40 PM Re: How do you set a 404 page?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I set it to a URL, and set that to /application_name/404.aspx - at least I'm not crazy to think this should work?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 09-03-2007, 08:11 PM Re: How do you set a 404 page?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Well don't I look silly. Who'da thunk it? You have to restart IIS or at least the web site after setting it. Duh.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 09-03-2007, 08:18 PM Re: How do you set a 404 page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
or use iisreset in a command prompt


It's only because it is a .aspx script it needs a restart and the .net framework has to compile it.
"classic" asp 404 scripts will just start up.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-03-2007, 08:26 PM Re: How do you set a 404 page?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Weird...I never knew that either. Then again, I don't mess with 404s using ASP.net. Classic ASP, like Hirst said, just works.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 09-03-2007, 09:51 PM Re: How do you set a 404 page?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
You can "bounce" IIS by saving the web.config file, too.

I'm not sure I follow what's going on, though. You should be able to add new pages when you want to, and the next time they're requested, if they haven't already been pre-compiled to a dll, they'll be compiled at that point, and the first request to that page will be slower than it feels like it should be. And then after that, it'll be served by the dll.

It sounds like compilation wasn't your problem, so much as IIS knowing where to route the error? I thought any changes to IIS settings were supposed to take place "on the fly?"

Quote:
Originally Posted by ADAM Web Design View Post
Weird...I never knew that either. Then again, I don't mess with 404s using ASP.net. Classic ASP, like Hirst said, just works.
It can be terribly annoying at times. Your pages are typically served up from a dll under a folder like "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\web\3af14531\28517a98" ... and occasionally you can get into file locking issues. That's rare, but a pain when it comes up.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by ForrestCroce; 09-03-2007 at 09:53 PM..
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 09-04-2007, 01:35 PM Re: How do you set a 404 page?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
It's not as bad as all that. I never had to go looking for dll files under my Windows directory or anything like that.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do you set a 404 page?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45191 seconds with 12 queries