How to make script paths inside user control independent of page hierarchy.
- by Rohit
My website is organized in the following folder structure
Root
Pages
CustomerManagement
DepartMentManagement
Script
UserControls
Now i have a user control inside userControl Folder. I have to use a external js file. So i use it this way
<script type="text/javascript" language="javascript" src="../Script/slider.js"></script>
My understanding is that since both are under root so i have used a single ..
Now what happens is that when this usercontrol is used inside DepartMentManagement it checks for script folder inside CustomerManagement as .. refers to one hierarchy above and script file is not found.Even using a ~ doesnot work.
I want to make this script path independent of the path where this control is used. I don't want to move script reference code to the page as control requires script mot page.Please tell me how to achieve this.