public IActionResult New([FromRoute] string controller) //We receive the value for controller from the Routing system. { BoundUser user = new BoundUser(); user.Controller = controller; return(View(user)); }
public IActionResult New([FromForm] BoundUser user) //We receive most of the User values from the Form data, except for Controller, which we receive from Routing. { var message = user.FirstName + " " + user.LastName + ", Date of Birth: " + user.DateOfBirth.ToString("yyyy-MM-dd") + ", ID: " + user.ID + ", Controller: " + user.Controller; return(RedirectToAction("index", new { message = message })); }