Last post Jul 12, 2010 02:26 PM by lautaro.arino
Jul 08, 2010 07:35 PM|lautaro.arino|LINK
I have 2 js files i need to access. They are located here ('/' is the root) :
I have 1 custom control that is located here:
I have 1 super master page witch is here:
I have two web form pages that include the custom control and uses the super master page:
The custom control contains in the <head>:
and in the <Body>
I would put the head tag like: "galleria/src/galleria.js"
And in the body: Galleria.loadTheme("galleria/src/themes/lightbox/galleria.lightbox.js");
But the custom control is now on two pages and they are in different folders. The custom control will have to be on more pages as well in the future. So my idea is to put in the super master page:
Cause then it starts from the root and finds the path no matter where it is reading from.
And then i would put in the custom control:
<script> Galleria.loadTheme("/CustomControls/galleria/src/themes/lightbox/galleria.lightbox.js"); </script>
Again here, the root relative path makes the path correct from any page in the website.
Hope this was enough info and explained properly. If not, let me know.
Thanks in advance!!!
Jul 12, 2010 05:34 AM|Qin Dian Tang - MSFT|LINK
The Scripts folder is in the root directory of the web site.
Jul 12, 2010 01:16 PM|lautaro.arino|LINK
Ok i have been reading up on JS and watch other websites source code. It seems that the solution IS root relative paths. That is to use "/CustomControl (etc....)" so that the path is correct from any page in any folder inside the
Is there some kind of conflict with JS and .NET that invalidates the root relative aproach?!?! What is going on here?!?! HELP!!!!
Jul 12, 2010 01:59 PM|lautaro.arino|LINK
The "/" root relative path works on my pages, but not in the code i have written.
The auto generated js code that .net makes when i debug my website uses / and it works. I chekc the source file in the browser and the jc src path is clickabel and shows the autogenerated js script. The path starts with "/".
But my path that i have written that starts with "/" dont work!!!!
What is this?!?!?!
Jul 12, 2010 02:26 PM|lautaro.arino|LINK
Im a complete idiot!
I dont deserve to own a computer....
For days i have been trying to get help about this.
Now i realized i was missing the absolute root folder in my path. The folder that holds the whole website.... now it works perferectly and i am a bit wiser, but feel a bit more stupid. Thanks for your time!