I have created a C# ASP.NET MVC
application. In the Index
view, i have added 3 buttons, when each button is clicked i want to execute 3 different functions from the Index
controller.
Index View that resides in the Home folder
@using (Html.BeginForm()) {
<input type="submit" value="b1" />
<input type="submit" value="b2" />
<input type="submit" value="b3" />
}
Home Controller
public ActionResult Button1Click()
{
return View();
}
public ActionResult Button3Click()
{
return View();
}
public ActionResult Button2Click()
{
return View();
}
When each button is clicked how can i write code to execute the correct controller method ?