I implemented the Url Helper extensions that Kazi Manzur suggested in his MVC best practice guide here
My extended Url extension method to get the 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 on my main page, I just add a jQuery script to my page like this:
<script type="text/javascript" src="<%= Url.Script("jquery-1.3.2.min.js") %>"></script>
How do I get intellisense working for jQuery since Visual Studio does not know at design time that jquery-1.3.2.min.js is included in the main page?
The workaround that I currently include is the following code (hardcode my -vsdoc script location) on my main page. This might be the best solution at the moment:
<% if (false) { %> <script type="text/javascript" src="~/Assets/Scripts/jquery-1.3.2-vsdoc.js"></script> <% } %>