WebUtils.ResolveUrl

Returns a site relative HTTP path from a partial path starting out with a ~. Same syntax that ASP.Net internally supports but this method can be used outside of the Page framework.

Works like Control.ResolveUrl including support for ~ syntax but returns an absolute URL.

public static string ResolveUrl(string originalUrl)

Return Value

relative url

Parameters

originalUrl
Any Url including those starting with ~ for virtual base path replacement

Remarks

Returns the path as relative of current location (ie. ./link.htm) if HttpContext is not available. Note that this may result in some scenarios where an invalid URL is returned if HttpContext is not present, but it allows for test scenarios.


See also:

Class WebUtils

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic