How to add a script in a partial view in MVC4?

前端 未结 9 1929
天涯浪人
天涯浪人 2020-12-05 09:15

This is the code which I have in my partial view

@model Contoso.MvcApplication.Models.Exercises.AbsoluteArithmetic

@using(Html.BeginForm())
{
9条回答
  •  [愿得一人]
    2020-12-05 10:08

    Check out my answer How to render a Section in a Partial View, which allows you to define Scripts and Styles in any view/partial view. It also takes care of duplicate includes.

    My personal take is that sections aren't a good solution for styles and javascript includes.

提交回复
热议问题