wwWebControl::ResolveUrl

Fixes up Urls based on an Application Relative path including support for ~ path syntax that injects the Application relative path into the URL.

When parsing the path, the ~ value is replaced with the Application's relative virtual path (ie. /wconnect/) which is appended to the Url provided replacing the ~. The application's relative path is retrieved from the app

For example:

Assume Web Connection is installed in /wconnect/ of the Web site and I want to reference an image in /wconnect/images/ while running the application out of /wconnect/weblog/.

To reference the image you can use:

~images/SomePic.gif

~ expands to the application's base path of /wconnect/ which is injected.

ResolveUrl is used on all URL based properties in Web Conntrols. So the HyperLink control, the WebImage control all use this functionality to provide consistent pathing in your apps.

this.picImage.ImageUrl = "~images/wconnect.gif"

o.ResolveUrl(lcUrl)

Parameters

lcUrl

Remarks

ResolveUrl relies on the wwProcess::cUrlBasePath property which is used to fix up paths. By default this value is set from the Process specific Configuration object defined in your Mainline PRG file and the related INI file key it uses. If you don't have a process level configuration object or the object is not hooked up or doesn't contain a cVirtualPath property the base path will end up blank and result in invalid Urls. To fix either assign cUrlBase in your Process startup code (OnProcessInit or Init or cUrlBasePath assignment) or make sure you create a configuration object and attach it to the server configuration object.


See also:

Class wwWebControl

© West Wind Technologies, 1996-2024 • Updated: 05/30/06
Comment or report problem with topic