If you have section like,
``` C#
@section scriptBlock{
var a = 1;
if(a < 3){
//
}
}
```
Then it will fail in Razor V2 but works in Razor V1. See this,
http://forums.asp.net/t/1893377.aspx/1?section+containing+jquery+code+not+working+after+migrating+to+MVC+4
Comments: This is a breaking change, but a desirable one. A section block should contain markup and razor code. Javascript at the top level is treated as markup, and in this case it's invalid markup. As the comments say, use <text></text> if you need to partially render a script.
``` C#
@section scriptBlock{
var a = 1;
if(a < 3){
//
}
}
```
Then it will fail in Razor V2 but works in Razor V1. See this,
http://forums.asp.net/t/1893377.aspx/1?section+containing+jquery+code+not+working+after+migrating+to+MVC+4
Comments: This is a breaking change, but a desirable one. A section block should contain markup and razor code. Javascript at the top level is treated as markup, and in this case it's invalid markup. As the comments say, use <text></text> if you need to partially render a script.