Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom "Page Cannot be Displayed"

Status
Not open for further replies.

dmh4ab

Programmer
Oct 2, 2002
53
US
I have a simple asp page that contains a link to a pdf file (file name coming from database).

Code:
Response.write &quot;<a href = 'C:\Documents and Settings\e164735\Desktop\Desktop Temp\&quot; & RsRecent(&quot;FileName&quot;).value & &quot;.pdf'>&quot; & RsRecent(&quot;RoutingCode&quot;).value & &quot;</a>&quot;

If the file for the pdf is not found I want to display a customized version of the standard &quot;The page cannot be displayed.&quot; It only needs to be a simple message instructing the user of who to contact to get the file loaded.

Is this possible. It sounds simple, but I haven't been able to dig up a solution.

Thanks in advance,
dmh4ab
 
This needs to be done through the IIS Internet Services Manager. You need to create your &quot;custom&quot; error page and set it as the default for the 404 error message in the &quot;custom errors&quot; tab in IIS. Keep in mind that you can set the custom error at the server, site, directory or file level.
 
Thanks fzylgk.
I changed the 404 file error and discovered that wasn't the error page it was displaying. It turns out that the page I was getting was the default. So, I deleted all the other defaults so that the only one the web site has is the one I created. Still no luck! I'll keep trying.
Any more suggestions??

Thanks,
dmh4ab
 
Yep,

I've got W2k servers. I customized the error pages by opening C:\WINNT\iisHelp\common\401-1.htm in Dreamweaver.

I kept having issues with sometimes the custom message displaying, and sometimes it wouldn't ...then I got wise and copied my newly created error page to the 2nd server on my domain, and all was well.

I guess you could use anything other than Dreamweaver to edit the page. Notepad would even work.
 
Ok....I had to leave this project for a few days, but now I'm back.
It seems that non of the custom error pages is the page I'm getting. The bottom of this page has &quot;Cannot find server or DNS Error. Internet Explorer&quot;.
What I really would like to do is be able to look for the file the user wants to view, open it if it is there, or redirect to a custom error page if it is not. I can do this just fine with files in the same directory as the web pages, but these files are on our local area network drive!!

Any suggestions would be greatly appreciated!!!

Thanks,
dmh4ab
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top