I have implemented the Url Helper extensions that Kazi Manzur has suggested in his MVC best practices guide here
My Url Helper extension method to get a script file:
public const string ScriptDir = "~/Assets/Scripts";
public static string Script(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format("{0}/{1}", ScriptDir, fileName));
}
And in my Master page I simply add the jQuery script to my page like so:
<script type="text/javascript" src="<%= Url.Script("jquery-1.3.2.min.js") %>"></script>
How would I get intellisense working for jQuery since Visual Studio doesn't know at design time that jquery-1.3.2.min.js is included in the Master page?
The workaround that I am currently including the following code (hardcode my -vsdoc script location) in my Master page. This may be the best solution at the moment:
<% if (false) { %> <script type="text/javascript" src="~/Assets/Scripts/jquery-1.3.2-vsdoc.js"></script> <% } %>