Managing Scripts for Razor Partial Views and Templates in ASP.NET MVC

added by russcam
11/17/2011 10:54:32 AM

1 Kicks, 189 Views

Useful HTML helpers for effectively managing JavaScript files and blocks of code within ASP.NET MVC layouts, views and templates.


11/17/2011 10:56:35 AM
That's really slick, I run into this problem quite often as we try to load everything (including jQuery) after we load the body of the page. As a result any script we have to run before the body loads can't take advantage of jQuery. I find that this does help us consider how we write code very carefully, but it does also make things more difficult sometimes.

11/17/2011 11:00:17 AM
Thanks! After some digging around in the framework, I think I've got a slightly more elegant approach. I've now updated the article with the new approach :)