Hello everyone,
I have 1 website on IIS ("myWebsite") and another inside this one ("secondWebsite") as an application. Both are ASP.NET Mvc websites.
I have a method who works perfectly on the first one :
public static string AbsolutePath(this UrlHelper url, string path)
{
Uri requestUrl = url.RequestContext.HttpContext.Request.Url;
string absoluteAction = string.Format("{0}{1}", requestUrl.GetLeftPart(UriPartial.Authority), path);
return absoluteAction;
}
The result is : http://myWebsite.com/path
I have the same method in the second Website, the result is the same, that's logic, but I don't want it !
The result should be : myWebsite.com/secondWebsite/path. (miss the http:// cause of spam prevention ^^).
Is there a good way to do that ?
Thanks.