InnerException:
ErrorCode=-2147467259
HResult=-2147467259
Message=A public action method ... was not found on controller '...Controller'.
Source=System.Web.Mvc
WebEventCode=0
You check and the action is right there!. In my case it looked like this.
//Get: ProductPartial Blocks
[HttpGet]
[AllowAnonymous]
public ActionResult ProductBlockPartial(int? ID)
{
if (ID.HasValue)
{
Product model = db.Products.Find(ID);
return PartialView(model);
}
else
{ return null; }
}
The answer, my friend, is that pesky [HttpGet]. That tells the action to only respond to get requests, and when you pushed the button to post data back to the page, it became a post. And the post flows down from the main page to the partial view as well.
Just remove the [HttpGet] from the action and you're good as gold!
...
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
No comments:
Post a Comment