I have 2 Views: one called Index and one called Summary. I want to be able to input the values on Index and display back the values to the user on Summary, similar to shopping cart functionality on your favorite e-commerce sites. The code for the Index is working as expected. Here's the code I have for my Create action result that is bound to the Save button on the grid.
[HttpPost]
public ActionResult Create([Bind(Prefix = "models")]List<ProductModel> products)
{
if (products != null)
{
products = CalculateRoyalties(products);
}
return RedirectToAction("Summary", products);
//return View("Summary", products);
}
I've tried both RedirectToAction and return View as seen in code above. Return View will call the page but will not redirect to it. RedirectToAction doesn't seem to do anything. In both cases, my screen returns to my Index page instead of my Summary page. The products is the list that I am passing to the Summary page to display.
Any help would be appreciated.
[HttpPost]
public ActionResult Create([Bind(Prefix = "models")]List<ProductModel> products)
{
if (products != null)
{
products = CalculateRoyalties(products);
}
return RedirectToAction("Summary", products);
//return View("Summary", products);
}
I've tried both RedirectToAction and return View as seen in code above. Return View will call the page but will not redirect to it. RedirectToAction doesn't seem to do anything. In both cases, my screen returns to my Index page instead of my Summary page. The products is the list that I am passing to the Summary page to display.
Any help would be appreciated.