Fix “A Public Action Method Was Not Found” in ASP.NET MVC 5
Quick answer. Check which controller, action name, and HTTP method actually arrived. Expose a public action for the intended verb and align the form target with the effective action name. ASP.NET MVC 5 · Action discovery Read request verb Inspect action selectors Match form and action Read request verb → Inspect action selectors → Match form and action What causes this error? An edit form loads successfully when you open GET /Orders/Edit/42. Clicking Save sends POST to the same path, but the controller only exposes an Edit action marked HttpGet. This walkthrough targets ASP.NET MVC 5 on .NET Framework with System.Web.Mvc. The snippets show the relevant controller, Razor or routing changes in a local test application. Reproduce the failure and apply the fix Start with the failing configuration below. Reproduce the request or render the affected view, then apply the corrected version and repeat the same request. Before · C# [HttpGet] public ActionResult Edit(int id) { return Vi...