views:

22

answers:

2

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?

A: 

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

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

<script src="<%= Url.Content("~/content/scripts/file.js") %>" 
    type="text/javascript"></script>
David Liddle