I get the following error message,
The public action method 'RenderMenu' was not found on the 'Web.Controllers.SiteController' controller.
However, this action exists and the controller exists (since it works everywhere on the site) I looked at the internal exception.
Failed to execute child request. Examine InnerException for more information.
(This is an internal exception ...)
Stack trace
in System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap [TResult] (Func`1 func) in System.Web.HttpServerUtility.ExecuteInternal (IHttpHandler handler, TextWriter writer, Boolean preservePathPathPathPath Boolean, PhyserveForm, PhysiverPath, Boreleput, PhysiverForm, Physician , Exception error, String queryStringOverride)
Now we have a website with a dynamic menu system, so we use RenderAction () on the general controller to create this menu system.
<% Html.RenderAction("RenderMenu", "Site"); %>
This call is made from MasterPage, and it works fine until there is such a validation error.
[HttpPost] public ActionResult Register(UserModel UserToAdd) { if(!ModelState.IsValid) { return View(UserToAdd); } //Run some validation if (_UserService.DoesEmailExist(UserToAdd.EMail)) { TempData["error"] = "Email Address Already in use!"; return View(UserToAdd); } //Add the user TempData["info"] = "User Added - " + UserO.ID; return View("Success"); }
It works great when it is a new user, but if someone enters an existing letter, we get the above error. This RenderAction method works throughout the site (this is the first form we added)
Any suggestions?