Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...custom error pagescustom error pages
Previous
 
Next
New Post
12/14/2006 4:31 AM
 
Hi, is it possible to create custom error pages that can be configured in IIS that contain .net code to grab variables such as referer, windows login name etc? I'm wondering how this can be achieved in relation to a DNN site.

Any help is much appreciated.
 
New Post
12/14/2006 11:32 PM
 

Need to configure custom error pages in IIS on the custom error tab of the website/virtual directory properties and have it point to your own .aspx pages.  then use the Request.ServerVariables["SERVER VARIABLE NAME"] to get HTTP_REFERRER, AUTH_USER OR LOGON_USER, although I'm not sure the forms authentication gives you a server variable that contains the current user?? 

 


Version: DNN 4.4.1
Hosting Provider: 1and1
RAISE
 
New Post
12/15/2006 3:49 PM
 
hi
thanks for the reply, i tried doing that but no matter what i named by class in code behind file there seemd to be a conflict and it couldn't be found, so i thought it wasn't possible to do this with DNN. would posting my code help?
 
New Post
12/16/2006 6:01 PM
 
I wouldn't create a code behind file because the IIS Error Messages are not really associated with a dll per se.  Lets say I have a custom 404.aspx page and I just put the access to the request.servervariables in the aspx page between Server Name: <%=Request.ServerVariables["SERVER_NAME"] %> tags (I'm a c# guy, so change the code accordingly).   Then in IIS click on the 404 error message and browse to your custom 404.aspx page and select it. Make sure you use URL not FILE because it needs to execute.  Also, do some reading on the custom errors tag in the web.config of .net.   That's how I prefer to do mine.

Version: DNN 4.4.1
Hosting Provider: 1and1
RAISE
 
New Post
12/21/2006 4:14 AM
 
Hi

I've tried the following code but I get no output when run from VS 2005 on a local IIS server.

[code]
<%@ Page Language="VB"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>An error has occurred</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
    <form id="form1" runat="server">
    <div>
    <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="logo.jpg" width="177" height="65" alt="logo"></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 <a href="mailto:webmaster@">webmaster@k</a>.
            <br>
            Thank you.</font></p>
                <table width="500" cellpadding="5" cellspacing="0" border="1">
                <tr><td>
                    <p><font face="Arial, Helvetica, sans-serif"><strong>Error 404 - Not found</strong><br />
<%
    Dim text As String
    Dim url As String
    url = Request.ServerVariables("url")
    Dim user As String
    user = Request.ServerVariables("LOGON_USER")
    Dim query As String
    query = Request.ServerVariables("Query_String")
    Dim host As String
    host = Request.ServerVariables("HTTP_HOST")
    Dim referer As String
    referer = Request.ServerVariables("HTTP_REFERER")

    text = "URL = " + url + ",<br />User login = " + user + ",<br />Query string = " + query + ",<br />HTTP Host = " + host + ",<br />Referer = " + referer
   
    Console.WriteLine(text)
%>
                    </font></p>
                </td></tr>
                </table>
              <p>&nbsp;</p>
            </td>
          </tr>
          <tr>
            <td colspan="2">&nbsp;</td>
          </tr>
        </table>
    </div>
    </form>
</body>
</html>
[/code]
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...custom error pagescustom error pages


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out