Url.Host in HttpContext.Current.Request and Page.Request
<p>I have following method:</p>

<pre><code>    public static string GetHttpHost(System.Web.HttpRequest hr)
    {
        return "http://" + hr.Url.Host + ":" + hr.Url.Port.ToString() ;
    }
</code></pre>

<p>When I call this method with <code>GetHttpHost(this.Request)</code> and <code>GetHttpHost(HttpContext.Current.Request)</code>, it returns different results.</p>

<p>For example:</p>

<ul>
<li>My request page is <a href="http://192.168.1.103/mypage.aspx" rel="nofollow">http://192.168.1.103/mypage.aspx</a></li>
<li>In mypage.aspx.cs, calling <code>GetHttpHost(this.Request)</code> returns <code>http://192.168.1.103:80</code></li>
<li>When rendering mypage.aspx, some biz logic is involved, so BLL.dll is loaded. In BLL.dll, calling <code>GetHttpHost(HttpContext.Current.Request)</code> returns <code>http://app133:80</code> (app133 is our web server's name)</li>
</ul>

<p>I searched in Stack Overflow, all related questions tell me that HttpContext.Current.Request and Page.Request are same object.</p>

<p>So, can anyone tell me what happened in my code?</p>

<p>Thanks.</p>
