Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering section from partial view using Razor View engine in MVC 3

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?

like image 950
Nps Avatar asked Sep 04 '11 13:09

Nps


1 Answers

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

like image 157
Ofer Zelig Avatar answered Nov 12 '22 13:11

Ofer Zelig