Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error executing child request for handler in view

I have an MVC 4 view where I render the following actions

@{     Html.RenderAction("Index", "Logo");     Html.RenderAction("Index", "MainMenu"); } 

I have a form on my view which is filled out and posted to the controller. In the controller I perform some tasks and then send the model back to my view

[HttpPost] public ActionResult Index(ManageAdministratorModel manageAdministratorModel) {      // I save some of the fields to the database here.      return View(manageAdministratorModel); } 

When I'm redirected to the view I receive the following error

Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.

on this line

Html.RenderAction("Index", "Logo"); 

Any idea why this is happening?

like image 962
Andre Lombaard Avatar asked Oct 09 '13 12:10

Andre Lombaard


2 Answers

Ok I found the problem, hopefully this will help someone in future.

The controllers for the partial views each contained the [HttpGet] attribute. For example

[HttpGet] public ActionResult Index() { } 

I remove the attribute from both controllers

public ActionResult Index() { } 

and everything is now working.

like image 83
Andre Lombaard Avatar answered Sep 23 '22 02:09

Andre Lombaard


I just got this error occurring in my razor when my partial view had a code formatting error in it.

If you click 'Continue' to get past the error, you'll see the actual error message displayed in the browser window that you loaded it from.

Correct the error in the partial view and it'll work!

like image 37
Luke Avatar answered Sep 23 '22 02:09

Luke