Hello All,
My Website is hosted on appHarbor.When I access a page it is appending a port no with the referred Url like:"http://www.test.com/test.aspx?returnUrl=http://www.test.com:11111/abc/kgh.aspx".
It is appending 11111 port no.There by I coundnt go to that page .
I have got a method but unable to understand and use it:
public static string ToPublicUrl(this UrlHelper urlHelper, Uri relativeUri)
{
var httpContext = urlHelper.RequestContext.HttpContext;
var uriBuilder = new UriBuilder
{
Host = httpContext.Request.Url.Host,
Path = "/",
Port = 80,
Scheme = "http",
};
if (httpContext.Request.IsLocal)
{
uriBuilder.Port = httpContext.Request.Url.Port;
}
return new Uri(uriBuilder.Uri, relativeUri).AbsoluteUri;
}
Can anybody help me...
Thanks