how to override a views Layout declaration

前端 未结 4 1292
無奈伤痛
無奈伤痛 2021-01-19 15:43

In asp.net MVC 3 is there a way to override the Layout declaration set in a view from a controller or action filter?

@{
    Layout = \"~/Views/Shared/_Layout.cshtm         


        
4条回答
  •  隐瞒了意图╮
    2021-01-19 16:20

    sorry to simply add a ref to one of my previous posts on this subject, but have a look here, it may give a wider view (pun intended) on the topic:

    Where and how is the _ViewStart.cshtml layout file linked?

提交回复
热议问题