ASP.NET 2.0 Master Page Relative Path Sub Folder Javascript problem

  • Thread starter michael.bollhoefer
  • Start date
M

michael.bollhoefer

I was running into issues with the images on the page not working under
sub folders. If you leave a master file in the root folder and place
content pages in the subfolder then when you hit a subfolder page the
images and javascript break. I then changed all the images on the page
to <asp:image ~/images/imageName.gif>. THat fixed my image problem.
Now when the page is rendered it converts the ~ into .. or ../..
However, I have not found a fix for the javascript! Any suggestions?
I have tried putting the ~/ into front of the mmenuns4.js file but that
only works for server side stuff. If you try and make the script
server side it buggers out. I am sure the answer lies in some
processing in the codebehind or something, but have to have found a
good answer.


<script type="text/javascript"
src='milonic_src.js'></script><noscript><div style="width:
655px;"><center>Javascript is disabled, please enable
it.</center></div></noscript>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript
src=mmenuns4.js></scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript
src=mmenudom.js></scr"+"ipt>");
</script>
<script type="text/javascript" src="menu_data.js">function
IMG1_onclick() { }
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top