MVC Sections DON’t Work in Partial Views
2014-01-16
We add JavaScript or jQuery in ASP.NET MVC views in the scripts section:
@section Scripts
{
}
However, we should know above section does NOT work in partial view.
What we can do are:
1: Put JavaScript in Parent view, or,
2: Put all JavaScript to a separate .js file; or,
3: Custom helpers. for example.