Web application absolute path

Wednesday, December 17th, 2008 | .NET

Just a reminder on how to get the absolute path for the webapplication in ASP.NET

HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) +        VirtualPathUtility.ToAbsolute(HttpContext.Current.Request.ApplicationPath)

This will return http://subdomain.domain.com/applicationname

You can drop those AppSettings with ApplicationPath :)

Tags:

No comments yet.

Leave a comment