1

Hai, I wanna ask something.. I was developed code in ASP.NET and C#. on masterpages i was added code similar for call javascript and CSS like

<link rel="stylesheet" type="text/css" href="/Css/reset.css" />
<script type="text/javascript" src="/Js/jquery-1.4.2.min.js"></script>

When I compiled it, it works 100 % but when I tried to deploy it to server..it doesn`t work. So if I want to running web on IIS I must change masterpage to

<link rel="stylesheet" type="text/css" href="Css/reset.css" /> => remove /

<script type="text/javascript" src="../Js/jquery-1.4.2.min.js"></script> => added ../

Can you give me a hint so I dont need to change code every time I want to deploy it to server..How I must write URL in masterpage? FYI : My Structur Folder like this

-Solution

  • CSS

  • JS

  • Masterpage

  • Page Folder ASPX..

Thanks in Advance..

Gianni Rivera
  • 95
  • 2
  • 7

1 Answers1

1

Yeah it's a pain. I hope this post is what you are after.

ASP.NET - path to use to reference .CSS and .JS

Community
  • 1
  • 1
Evil Pigeon
  • 1,887
  • 3
  • 23
  • 31