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 error pages for iis

Status
Not open for further replies.

ahevans

Technical User
Jan 27, 2006
26
GB
hi

i'm using the following code as a custom error page in iis in an integrated authentication environment but it wont work. any suggestions?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>An error has occurred</title>
<SCRIPT LANGUAGE="vbscript" runat="server">
Public Function LoggedOnUser as string
return Request.ServerVariables("LOGON_USER")
End Function
Public Function URL() as string
return Request.ServerVariables("url")
End Function
Public Function QUERYSTRING() as string
return Request.ServerVariables("Query_String")
End Function
Public Function HTTPHOST() as string
return Request.ServerVariables("HTTP_HOST")
End Function
Public Function HTTPREFERER() as string
return Request.ServerVariables("HTTP_REFERER")
End Function
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td>
<h1><font face="Arial, Helvetica, sans-serif">An error has occurred</font></h1>
</td>
<td>
<div align="right"><font face="Arial, Helvetica, sans-serif"><img src="\nhsp_logo.jpg" width="177" height="65" alt=""></font></div>
</td>
</tr>
<tr>
<td colspan="2">
<p>&nbsp;</p>
<p><font face="Arial, Helvetica, sans-serif">Please copy and paste the text
below into a an email and send to .
<br>
Thank you.</font></p>
<form name="error_form" method="post" action="">
<font face="Arial, Helvetica, sans-serif">
<textarea name="textfield" rows="10" cols="50">HTTP Error 404 Not Found
<%
response.write("URL = ")
response.write(URL)
response.write("Logged on user = ")
response.write(LoggedOnUser)
response.write("Query string = ")
response.write(QUERYSTRING)
response.write("Current domain = ")
response.write(HTTPHOST)
response.write("Refering URL = ")
response.write(HTTPREFERER)
%>
</textarea>
</font>
</form>
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</table>
</body>
</html>
 
ok, pretty dumb of me, it won't work as in te textarea displays the code instead of the intended text, so...

response.write("URL = ")
response.write(URL)

... is displayed instead of something like 'URL =
 
Using inline <% %> in your code is a classic ASP method. For ASP.NET, I suggest you read up on using the code-behind method. This will also allow you to debug your application and see where you are going wrong.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top