Child actions are not allowed to perform redirect actions - error while working with ASP.NET MVC 2 and Razor
问题 In _Layout.cshtml file I have following entry: @Html.Action("LoadPagesStructure", "Page") Inside PageController class, LoadPagesStructure methos looks following: [ChildActionOnly] /* this attribute indicates that an action should not be invoked as a result of a user request (by url) */ public ActionResult LoadPagesStructure() { ViewModel.Pages = new List<string>() {"page1", "page2", "page3"}; return View(); } Finally, my LoadPagesStructure.cshtml view looks like below: @inherits System.Web