Resolves ~/
in a URL like ~/page.wc
or ~/subfolder/page.wc
to a site relative path like /wconnect/page.wc
or /wconnect/subfolder.wc
.
Using ~/
allows for running a site in a virtual directory (ie. base is /wconnect
) or in a Root site (ie. base is /
) and avoids having to hardcode the site relative path. ~/
figures out the site's base path and adjusts.
It's recommended you always use ~/
paths for any resources for cleaner handling of relative links and resources.
More info this blog post:
o.ResolvePath(lcPath)
Return Value
Adjusted path.
Parameters
lcPath
A disk path. Any path prefixed with ~\ replaces the ~\ to the Root path of the server or virtual (ie. using Request.GetApplicationPath()).
Remarks
ResolveUrl relies on the
cUrlBasePath
andcVirtualPath
properties which are set by the Web server based on the URL based exposed. Older Web Servers don't expose these values and when that's the case the Process configuration incHtmlPagePath
andcVirtualPath
. It's recommended you set these vales in theMyApp.ini
file for each process class as a fallback.
See also:
Class wwProcess© West Wind Technologies, 1996-2024 • Updated: 06/07/20
Comment or report problem with topic