The following attributes are some of the usefull properties of the URL object. I use the following url to send my request to localhost:
http://localhost/Test/Asghar.aspx?test=fine
And I get the following results:
AbsolutePath = /Test/Asghar.aspx
AbsoluteUri = http://localhost/Test/Asghar.aspx?test=fine
Authority = localhost
DnsSafeHost = localhost
Fragment =
Host = localhost
HostNameType= Dns
IsAbsoluteUri = True
IsFile = False
LocalPath = /Test/Asghar.aspx
OriginalString = http://localhost:80/Test/Asghar.aspx?test=fine
PathAndQuery = /Test/Asghar.aspx?test=fine
Port = 80
Query = ?test=fine
Scheme = http
UserEscaped = False
UserInfo =
And the code to do it is as followes:
AbsolutePath = <%= System.Web.HttpContext.Current.Request.Url.AbsolutePath %><br />
AbsoluteUri = <%= System.Web.HttpContext.Current.Request.Url.AbsoluteUri %><br />
Authority = <%= System.Web.HttpContext.Current.Request.Url.Authority %><br />
DnsSafeHost = <%= System.Web.HttpContext.Current.Request.Url.DnsSafeHost %><br />
Fragment = <%= System.Web.HttpContext.Current.Request.Url.Fragment %><br />
Host = <%= System.Web.HttpContext.Current.Request.Url.Host %><br />
HostNameType= <%= System.Web.HttpContext.Current.Request.Url.HostNameType.ToString() %><br />
IsAbsoluteUri = <%= System.Web.HttpContext.Current.Request.Url.IsAbsoluteUri %><br />
IsFile = <%= System.Web.HttpContext.Current.Request.Url.IsFile %><br />
LocalPath = <%= System.Web.HttpContext.Current.Request.Url.LocalPath %><br />
OriginalString = <%= System.Web.HttpContext.Current.Request.Url.OriginalString %><br />
PathAndQuery = <%= System.Web.HttpContext.Current.Request.Url.PathAndQuery %><br />
Port = <%= System.Web.HttpContext.Current.Request.Url.Port %><br />
Query = <%= System.Web.HttpContext.Current.Request.Url.Query %><br />
Scheme = <%= System.Web.HttpContext.Current.Request.Url.Scheme %><br />
UserEscaped = <%= System.Web.HttpContext.Current.Request.Url.UserEscaped %><br />
UserInfo = <%= System.Web.HttpContext.Current.Request.Url.UserInfo %><br />
<hr />