Re: Host Name of the request

"Efran Cobisi, cobisi.com" <[email protected]> Wed, 19 Sep 2007 20:05:42 +0200
Newsgroups gmane.comp.windows.devel.dotnet.web
Organization cobisi.com
Message-ID <[email protected]>
Hi Sudhakar,

Request.UrlReferrer.Host returns the host part of the referrer uri. So,
this value is unpredictable because it depends on the Referer HTTP
header the client should send to the server [1]. Browsers normally send
this header according to the uri the resource was obtained from.
I don't know if this is your case but, if you need to access the host
part of the current request url you just need to use the
Request.Url.Host instead of that one.

Hope this helps.

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.36

--
Efran Cobisi
http://www.cobisi.com

Sudhakar Jalli wrote:
> Hello all,
>
> I have a question around the host name. I believe the following statement
> returns the host name.
>
> Request.UrlReferrer.Host
>
> If my url is http://test.web.com/testing/one.aspx
> The result of the above statement would be test.web.com
>
> If my url is http://www.one.com/testing/one.aspx
> What would be the result of the above statement?
>
> Any help appreciated.
>
> Thanks
> NM
>
> ===================================
> This list is hosted by DevelopMentor�  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>
>
>

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com