04-04-2023, 07:12 AM
(04-03-2023, 06:11 AM)baxing Wrote: If "/myIWProject.dll" is normal standard path of ISAPI please advice me for declare css or js file path to me for work fine on both SA and ISAPI.
such I want to refer to
- CSS files : "assets/mycss.css" in folder wwwroot
- JS files : "assets/myjs.min.js" in folder wwwroot
How should I give string argument to AddBodyScriptFile and ContentFiles?
Now I using :
ContentFiles.Add('/assets/mycss.css');
PageContext.AddBodyScriptFile('/assets/myjs.min.js');
Them work fine for the SA but doesn't work for the ISAPI.
Thanks
Hi
Use the ServerController URLbase property:
cssfile := IWServerController.URLBase+'assets/mycss.css';
------
URLBase: string; [Published, Read/Write]
URLBase is the common prefix found while navigating inside a given website is known as the base URL. The URLBase is concatenated with the server's root URL to form the application URL. Example: server URL is www.yourserver.com and application URLBase is /myapp/, the application root url will be http(s)://www.yourserver.com/mypp/
https://docs.atozed.com/docs.dll/classes...rBase.html