mvc redirecttoaction with parameters code example
Example 1: asp.net core redirecttoaction with parameters
RedirectToAction("Action", "Controller" ,new { id });
Example 2: mvc redirect to action with parameters
return RedirectToAction("Action","controller", new {@id=id});
Example 3: redirecttoaction not sending id
return RedirectToAction("IngredientIndex", new { id = id });
Example 4: mvc redirect to action with parameters
return RedirectToAction( "Main", new RouteValueDictionary(
new { controller = controllerName, action = "Main", Id = Id } ) );