Injecting content into specific sections from a partial view ASP.NET MVC 3 with Razor View Engine

后端 未结 24 1647
无人共我
无人共我 2020-11-22 06:13

I have this section defined in my _Layout.cshtml

@RenderSection(\"Scripts\", false)

I can easily use it from a view:

24条回答
  •  孤独总比滥情好
    2020-11-22 06:59

    Well, I guess the other posters have provided you with a means to directly include an @section within your partial (by using 3rd party html helpers).

    But, I reckon that, if your script is tightly coupled to your partial, just put your javascript directly inside an inline

提交回复
热议问题