I have an create action in my controller for the HttpPost. inside that action I insert the record in the db, and then return a view specifying a different action name, because I want to take the user somewhere else, such as to the details view of the record they just created, and I pass in the current model so I don't have to re-load the data they just entered. Unfortunately, the url in the address bar still shows the original create action.
[HttpPost]
public ActionResult Create(MyModel model)
{
//Insert record
...
//Go to details view, pass the current model
//instead of re-loading from database
return View("Details", model);
}
How do I get the url to show "http://myapp/MyController/Details/1", instead of "http://myapp/MyController/Create/1"? Is it possible, or do I have to do a redirect? I'm hoping I can avoid the redirect...