On submit of the page on the view, I need to call a method in the Controller.
I am not sure how to do this. If you can provide a small example on how to call the Controller that would be appreciated.
On submit of the page on the view, I need to call a method
Share
Edit: Not sure what framework you are using to develop your application, but here is an example using ASP.NET MVC.
It sounds like you want to know how to use an Action method defined in the Controller to handle the processing of a form submitted from a View. This example uses the Razor view engine. In your view, you can create the form using the
BeginFormhelper method like so:where the strings “Action” and “Controller” are the names of your action method and controller, respectively.
Note the HTML that is rendered contains the /controller/action route in the action attribute of the form tag:
Also note that you don’t have to use helper methods, you can just create your own form using the HTML above.