using formcollection to show data on view
I have two action methods in my controller class both with same name. One of them is httpGet
and the other one is HttpPost
. I have created one view to input values. Now I need to sum the开发者_JS百科se values and show it to other view.
My problem is, I can't create two views with same name in same views folder.
The second Action method is like this:
[HttpPost]
public ActionResult Add(FormCollection formCollection)
{
return View(formCollection);
}
where formCollection
holds values entered by user. I need to sum these values and show them to the other view. How can I do this?
Don't quite get what you need but maybe you could return a specific view:
return View("Result", formCollection);
HTH
精彩评论