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();
}
精彩评论