How to Handle Multiple Submit Buttons On The Same Form in MVC 6

How to Handle Multiple Submit Buttons On The Same Form in MVC 6

In this post we will explain you about Handling multiple submit buttons on the same form in MVC.To fix this problem, I’m progressing to justify the varied techniques for handling multiple buttons on the same form in Sometimes you got situation like more than one submit buttons on a similar form in ASP.NET MVC 6. At that point, How we will handle the click event of every and each buttons on your form? Suppose you’ve got a user Login form like as below:

index

On the above picture, we have the SignUp, SignIn and the Cancel buttons. Suppose on Signup button click you have to open Signup window & on SignIn button click you have to open Login window and on Cancel button click you are returning to home page. For handling all of the above buttons, we have the following methods:

  • Export Gridview to Excel: Gridview to Excel
  • Insert,Update,Delete in ModalPopup CRUD operation in ModalPopup
  • Read and Write in Text File in ASP.NET Read and Write File in ASP.NET

Now, Make the view Form with Multiple Button in Home Folder with the following code.

Next step, in Homecontroller include the MultipleCommand Method to handle the multiple button with the following code.
Aagni Yashu
Aagni Yashu

Aagni Yashu a freelance writer, blogger, and ghostwriter who develops high-quality content for businesses. She is also a HubSpot Inbound Marketing Certified and Google Analytics Qualified Professional.