HttpContextExtensions.ResolveUrl

Resolves of a virtual Url to a fully qualified Url.

  • ~/ ~ as base path
  • / as base path
  • https:// http:// return as is
  • Any relative path: resolved based on current Request path In this scenario ./ or ../ are left as is but prefixed by Request path.
  • Empty or null: returned as is
public static string ResolveUrl(HttpContext context, string url, 
			string basepath, bool returnAbsoluteUrl, 
			bool ignoreRelativePaths, bool ignoreRootPaths)

Remarks

Requires that you have access to an active Request


© West Wind Technologies, 2025 • Updated: 2025-03-08
Comment or report problem with topic