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..

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I can`t write it in masterpage :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.