Rendering section from partial view using Razor Vi

2019-06-15 03:55发布

I have rendering a section in the bottom master layout. This is typically section to render javascript at the bottom of the page when it renders. Defining that section in View and _partial views. When page renders, it renders section from page view but not from the _partial view.

How it is possible to render a section defined in _partial view to main layout?

1条回答
Juvenile、少年°
2楼-- · 2019-06-15 04:38

You can use Html.RenderAction/Html.Action or use helpers like demonstrated here: https://stackoverflow.com/a/5433722/290343

查看更多
登录 后发表回答