return RedirectToAction("ActionName", new { lst = finalData });
[HttpGet]
Public ActionResult AcionName(IGrouping<string, ModelName> lst)
{
return View("ActionName", lst);
}
i use this code to redirect my list to another action but this is not working.
You can assign the
finalDatato aSessionorTempDatavariable.From this answer: "
TempDataAllows you to store data that will survive for a redirect. Internally it uses the Session, it's just that after the redirect is made the data is automatically evicted"Then in your
GETAction Method,The problem is, if you were to refresh after the redirect, then
finalDatawould be null. So, in that case you useSession["FinalData"]or get the data from the Database in your Get method again. You can go through the answer I have linked for disadvantages of usingTempData.