public string GetApplicationPath()
{
string applicationPath = "";
if (this.Page.Request.Url != null)
applicationPath = this.Page.Request.Url.AbsoluteUri.Substring(
0, this.Request.Url.AbsoluteUri.ToLower().IndexOf(
this.Request.ApplicationPath.ToLower(),
this.Request.Url.AbsoluteUri.ToLower().IndexOf(
this.Page.Request.Url.Authority.ToLower()) +
this.Page.Request.Url.Authority.Length) +
this.Request.ApplicationPath.Length);
return applicationPath;
}