asp.net.ph

Request.UrlReferrer Property

System.Web Namespace   HttpRequest Class


Gets information about the URL of the client's previous request that linked to the current URL.

[ VB ]
Public ReadOnly Property UrlReferrer As Uri

[ C# ]
public Uri UrlReferrer {get;}

[ C++ ]
public: __property Uri* get_UrlReferrer ( );

[ JScript ]
public function get UrlReferrer ( ) : Uri;

Property Value

A Uri object.

Example

The following example renders a list of the properties of the URL that referred the client to the current application.

<table width=50% cellspacing=1 class="data" >
<tr>
  <th colspan=2>Referring URL Properties</th></tr>
<tr>
  <td>AbsolutePath</td>
  <td><%= Request.UrlReferrer.AbsolutePath %></td></tr>
<tr>
  <td>AbsoluteUri</td>
  <td><%= Request.UrlReferrer.AbsoluteUri %></td></tr>
<tr>
  <td>Authority</td>
  <td><%= Request.UrlReferrer.Authority %></td></tr>
<tr>
  <td>LocalPath</td>
  <td><%= Request.UrlReferrer.LocalPath %></td></tr>
<tr>
  <td>Port</td>
  <td><%= Request.UrlReferrer.Port %></td></tr>
<tr>
  <td>Scheme</td>
  <td><%= Request.UrlReferrer.Scheme %></td></tr>
<tr>
  <td>UserInfo</td>
  <td><%= Request.UrlReferrer.UserInfo %></td></tr>
</table>

NOTE: UrlReferrer will only work with requests that load in the same or another browser window invoked via a hyperlink. No UrlReferrer object is returned when loading pages into a window using client-side scripting methods. Hence, attempting to retrieve any of the object's property in this case results in an error.

 Show me 

See Also

HttpRequest Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph