I have two text box and a submit button.i
want to take two number using these
textboxes and display the result when button
is clicked...How can i do it?
My controller name is"Home" action is"Index"
Add two number in ASP.NET MVC
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Ravi PatelRank #439 · 5.7K reputationPosted Feb 10, 2015, 1:06 AM EST
in your html page
And in your Home controller
public ActionResult Index(int firstnumber=0,int secondnumber=0)
{
int result = firstnumber + secondnumber;
ViewBag.res = result;
return View();
}