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"
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi PatelPosted Feb 10, 2015, 6:06 AM
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();
}