I have a directory structure in my project (something) similar to this one:
Root
|
|- Utilities
|
|- Modules
|
|- Admin
in the admin directory, I have a simple page default.aspx and a javascript file validation.js
I am just trying to refer to this file in my aspx page like
<script src="validation.js" ...></script>
since I am using route handlers, my url will be like this template
http://mysubdomain.mysite.com/admin/UserId/manage
(replace userid with a triple des encrypted string and you are set)
so since the relative path is being used to access the js file, when I try to check in firebug, its trying to access the js file with this path:
http://mysubdomain.mysite.com/admin/UserId/manage/validation.js
of course, its not present. the only way I see is to specify full relative path
src="\modules\admin\validation.js"
surely, there should be some way I can use this validation js without the full relative path. How to get that?
thanks.
ps: this is all in .aspx page and not codebehind (.cs)
I have had this problem too but never been able to do anything about it. I usually end up using a full relative path and if the directory changes, well, I have to change it manually everytime. I see no other way to do this.
Of course, I would love to be proved wrong.