Blog Archives

How to handle multiple submit buttons on a single form – MVC Razor

In MVC, there is no click event like(Button_Click) for buttons, action is used to handle the post action of the buttons.

(There are various ways for handling multiple submit buttons on the same form but the best two are below)

Method 1: Handle all Submit Buttons post in one Action:

Example: Suppose we have to perform some mathematical operation like (Add, Substract, Multiply, Divide) with 2 numeric values.

For this case, we will create a form and add 2 TextBoxes and 4 submit buttons for each opeartion (Add, Substract, Multiply and Divide).

Read the rest of this entry