I have a controller with the following actions:
public ActionResult Create()
{
return View(new MyModel());
}
[HttpPost]
public ActionResult Create(MyModel model)
{
//Update database
...
//Pass the current model so we don't have to load it from the database
return View("Details", model);
}
[HttpPost]
public ActionResult Details(MyModel model)
{
}
Both my create.aspx and Details.aspx page have a submit button. The submit on the create.aspx page will cause a record to be insert into the database, and then it goes to the details view. That part works fine, I can click the submit button, the record gets inserted and goes to the details view for that record. Now if I click submit in details view, the Create(MyModel model) still gets called. Shouldn't the Details(MyModel model) method get called?
In the method for the create post, I want to transfer to the details view and pass the current model, so that don't have to reload that data from the database.