Does anyone know if the ASP.NET MVC 3 team have come out with any changes that will stop the Razor syntax highlighter in VS2010 showing so many errors when I embed JavaScript in my razor pages. My code seems to work but it is very confusing when it comes to me trying to debug. Surely by now they have some fixes so I don't have to look at green underlines and see strange synax error messages.
2 Answers
I know that the general push is for the separation of code. Meaning, there is a strong push to keep your JavaScript in separate .js files, your CSS in separate .css files, and your views in their own files (separate from their controllers obviously).
I think that you should have relief from the green underlines and syntax messages if you put the JavaScript in separate files.
Additionally, there are a couple JavaScript extensions that you can add to Visual Studio to help with these regardless of where the JavaScript is located.