Click here to Skip to main content
15,897,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I do have a Submit Button action in MVC4?

VB
@Using (Html.BeginForm("Output", "Home", FormMethod.Post))
    ...
   //Submit button
End Using
Posted

Anything of type button on the form will cause the form to submit.

HTML
<button>Submit</button>


You can also have a button of type submit

HTML
<input type="submit" value="Submit" />


Alternately, you can have buttons with an ID or class, and catch the click with javascript. In that case, you can either submit via javascript, or just call your forms submit action.

JavaScript
$(function(){
    $("#submit_it").click(function(){
        //do work here
        return false;
    });
});

HTML
<button id="submit_it">Submit</button>
 
Share this answer
 
within your form statement add an input type submit.
HTML
<input type="submit" value="Submit" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900