I am working on a sample application where I have a register and detail actions. I want to redirect to the detail view after I registered a new team.
My Regsiter post code looks like this;
[HttpPost]
public async Task<ActionResult> Register(TeamEditorVm teamRegisterVm)
{
if (ModelState.IsValid)
{
var teamDetailVm = await Managers.TeamManager.CreateAsync(teamRegisterVm);
return RedirectToAction("Details", new { id = teamDetailVm.Id });
}
return View(teamRegisterVm);
}
Is there a way to force RedirectToAction("Details", new { id = teamDetailVm.Id }); to use route values for the URL like
hxxps://test.com/team/detail/1
instead of a querystring?
hxxps://test.com/team/detail?id=1
../team/details/1if your using the default routing. Show your current route definitions and the signature of theDetails()method