BeginForm with areas don't submit

133 views Asked by At

I decided to organize my app with Areas and now some forms won't submit.

The Controller

public class SoftwareInfoController{
    public ActionResult Index(){...}
    public ActionResult New(){...}
    [HttpPost]
     public ActionResult Save(SoftwareInfoViewModel viewModel){...}
}

I can access the view like this, "Packaging" being an Area

webpage.com/Packaging/SoftwareInfo/Index
webpage.com/Packaging/SoftwareInfo/New

Both Index and New methods are working correctly. But I cannot get the form to submit.

edit.cshtml
@model SoftwareInfoViewModel 
...
@using (Html.BeginForm("Save","SoftwareInfo")){...} // does nothing
@using (Html.BeginForm("Save","SoftwareInfo", FormMethod.Post)){...} // does nothing
@using (Html.BeginForm("Save","SoftwareInfo", new {Area = "Packaging" })) {...}// does nothing

Routing

    context.MapRoute(
    name: "Packaging_default",
    url: "Packaging/{controller}/{action}/{id}",
    defaults: new { controller = "Editor", action = "Index", id  =UrlParameter.Optional },
    namespaces: new[] { "WebApp.Areas.Packaging.Controllers" }
    );
1

There are 1 answers

0
BenoitM On

Solved,

If someone get this issue, make sure that your Remote attribute method links in your model are not broken!