How to resolve relative url's without ResolveUrl

Sometimes you need to resolve relative url's without ResolveUrl. If the code is executing outside a Control, for example in an IHttpHandler or business layer code somewhere that has no reference to a Control, you can't call Control.ResolveUrl.
The System.Web.VirtualPathUtility class has some very useful method for converting from an app relative path to an absolute path:
string absoluteUrl = VirtualPathUtility.ToAbsolute(relativeUrl);

Comments

Popular posts from this blog

Understanding Top line and Bottom line?

How to activate PF UAN account

Scrum Master vs Product Owner