S
Stuart
Hi All,
I got a challenge to make the same APS/Script/Html run on different web
roots. I can not use relative pathing in a lot of cases. We use lots of
included files so depending on where that file is running, the pathing in
those included files varies. So we do a lot of absolute pathing.
Example: Instead of Mappath("../../../_scripts/menu/mymenuscript.js") we use
mappath("/_scripts/menu/mymenuscript.js").
In one case, the code is loaded right on wwwroot with all the folders off of
wwwroot.
So a path like so mappath("/_scripts/menu/mymenuscript.js") would return
c:\inetpub\wwwroot\_scripts\menu\mymenuscript.js
In another case, the SAME code has to run under a subweb, so we would have
to include the subweb name like so.
mappath("/MySubWeb/_scripts/menu/mymenuscript.js") would return
c:\inetpub\wwwroot\MySubWeb\_scripts\menu\mymenuscript.js
So how do you solve this.
With ASP pages, I could detect where I'm running in the global.asa and set a
APP variable and use that variable anywhere I'm building a path name. I
would have to modify all the HTML code etc <A
HREF='<%Application("BasePath")%>/myfolder/mywebpage.htm'>MyLink</A>
This is a pain...but doable. But that does not address a lot of the pure
HTML files or included script files in the ASP pages or Included ASP files..
Examples:
How would I change an ASP include file.
<!--#INCLUDE Virtual ="/Includes/MyAsp.asp" -->
Or a JScript include like this
<script type="text/javascript" language="javascript"
src="/_scripts/MainMenu/MyMenuScripts.js"></script>
Then there is the issue of the client side JScript having to know that
pathing info which could be in a included file like the example above.
Looking for some ideas...examples would be great too.
Thanks
Stuart
I got a challenge to make the same APS/Script/Html run on different web
roots. I can not use relative pathing in a lot of cases. We use lots of
included files so depending on where that file is running, the pathing in
those included files varies. So we do a lot of absolute pathing.
Example: Instead of Mappath("../../../_scripts/menu/mymenuscript.js") we use
mappath("/_scripts/menu/mymenuscript.js").
In one case, the code is loaded right on wwwroot with all the folders off of
wwwroot.
So a path like so mappath("/_scripts/menu/mymenuscript.js") would return
c:\inetpub\wwwroot\_scripts\menu\mymenuscript.js
In another case, the SAME code has to run under a subweb, so we would have
to include the subweb name like so.
mappath("/MySubWeb/_scripts/menu/mymenuscript.js") would return
c:\inetpub\wwwroot\MySubWeb\_scripts\menu\mymenuscript.js
So how do you solve this.
With ASP pages, I could detect where I'm running in the global.asa and set a
APP variable and use that variable anywhere I'm building a path name. I
would have to modify all the HTML code etc <A
HREF='<%Application("BasePath")%>/myfolder/mywebpage.htm'>MyLink</A>
This is a pain...but doable. But that does not address a lot of the pure
HTML files or included script files in the ASP pages or Included ASP files..
Examples:
How would I change an ASP include file.
<!--#INCLUDE Virtual ="/Includes/MyAsp.asp" -->
Or a JScript include like this
<script type="text/javascript" language="javascript"
src="/_scripts/MainMenu/MyMenuScripts.js"></script>
Then there is the issue of the client side JScript having to know that
pathing info which could be in a included file like the example above.
Looking for some ideas...examples would be great too.
Thanks
Stuart