redirect toaction with parameter code example
Example 1: redirecttoaction with parameters
return RedirectToAction("Action", new { id = 99 });
Example 2: redirecttoaction with parameters model
[HttpPost]
public ActionResult FillStudent(Student student1)
{
TempData["student"]= new Student();
return RedirectToAction("GetStudent","Student");
}
[HttpGet]
public ActionResult GetStudent(Student passedStd)
{
Student std=(Student)TempData["student"];
return View();
}