Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
435 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...