ResolveUrl without an ASP.NET Page

Try to get the page from the handler and use ResolveUrl, or create a Control object…

(HttpContext.Current.Handler as Page).ResolveUrl("~/virtualpath");

Or use VirtualPathUtility.ToAppRelative(string) or VirtualPathUtility.ToAbsolute(string)

For example:

System.Web.VirtualPathUtility.ToAbsolute("~/Styles/Contoso.xslt");

returns

/WebSite/Styles/Contoso.xslt

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)