0

How can I link to resources such as css and javascript files? My default project is using links like ../../Content/styles.css. How can I do something like ~/content/styles.css?

2 Answers 2

1
<link rel="stylesheet" href="<%= Url.Content("~/content/styles.css") %>" 
    type="text/css" />

<script src="<%= Url.Content("~/content/scripts/file.js") %>" 
    type="text/javascript"></script>
Sign up to request clarification or add additional context in comments.

Comments

0

Leave out the ~. "/Content/styles.css"

Comments

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.