开发者

Do not apply _ViewStart to child actions

My _ViewStart sets Layout property. It worked fine untill I started to use child actions - in this case Layout is applied both for main action and for 开发者_Go百科child. Is there any way to deny applying _ViewStart (or at least Layout) to child actions?


It sounds like you need to make sure you child action renders a PartialView:

AKA

 @Html.Action("YourActionMethodName");

The code would look like so:

 public ActionResult YourActionMethodName()
 {
      return PartialView();
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜