Click here to Skip to main content
15,891,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Redirect from Click on Submit Button in view to Mvc Controler function with the help of jquery

jquery for redirect from button click to any function defined on controller in MVC
Posted
Comments
John C Rayan 25-Sep-15 4:21am    
what have you tried so far? You could write jQuery function for button click and call the action (method) in Controller.
F-ES Sitecore 25-Sep-15 5:31am    
window.location.href = '@Url.Action("ActionName", "ControllerName")';
CHill60 25-Sep-15 6:07am    

1 solution

Place that input Submit button inside a Html.BeginForm tag

C#
@using (Html.BeginForm("ActionName", "ControllerName", FormMethod.Post))
{
     <input id="btnSubmit" type="submit" value="Save" />
}
 
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