I think the problem is the way sections are rendered when they are put in partial views. I think your script sections in the partial view is not being put into the rendersection block in your layout/view. Try moving all your script into another partial view
and render that partial view where ever you want it to be rendered.
The sections doesnt work if your rendersection is defined in your layout, as the partial view doesnt have layout defined, only your view has the layout defined. So section defined in your view will get rendered in the rendersection block. Dont ask me why
!, i have seen this behaviour in razor.
Hope i am hitting the right target!
Cheers,
Gopakumar
| Please click “Mark as Answer” on the post(s) if it helps |
gopakumar.r
Participant
959 Points
193 Posts
Re: ModelState.AddModelError is not being displayed inside my view
May 03, 2012 05:09 AM|LINK
I think the problem is the way sections are rendered when they are put in partial views. I think your script sections in the partial view is not being put into the rendersection block in your layout/view. Try moving all your script into another partial view and render that partial view where ever you want it to be rendered.
The sections doesnt work if your rendersection is defined in your layout, as the partial view doesnt have layout defined, only your view has the layout defined. So section defined in your view will get rendered in the rendersection block. Dont ask me why !, i have seen this behaviour in razor.
Hope i am hitting the right target!
Gopakumar
| Please click “Mark as Answer” on the post(s) if it helps |