[HttpPost]
[Route("{appId}/Contract/Create")]
public ActionResult Create(ContractViewModel vm, string appId)
{
// ...
if (!ModelState.IsValid)
{
return View("Create", vm);
}
// ....
}
If the controller is called the 1st time string appId
is perfectly filled with the RouteDictionary value {appId}
. But if the ModelState is not valid and the client have to post a second time the parameter string appId
is empty. (The RouteValues still contains the correct {appId}
, the Form keeps the correct action url.) What am I doing wrong?