We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to invoke action by button click?

Description

You can invoke the controller action by Button using click event to your Syncfusion Button control. In the click event, you can use Url.Action method to invoke the particular action.

Solution

You can invoke the controller method by button click using the following code example. To include the Syncfusion components, add the necessary script and theme files in the <head> section as illustrated in the following code example.

HTML

You can create Button in CSHTML page as follows.

CSHTML

You can write the Url.Action for the Button click event in the script section as follows.

JavaScript

In the Url.Action you can specify the Controller name and the Action name. Finally, when you click on the Button, the click event is triggered and redirected to the corresponding method in a specified controller. Here, when you click on the Button it is redirected to the “Index” method in the “Home” controller. You can download the complete sample under the following location.

Sample Location: Sample

Article ID: Published Date: Last Revised Date: Platform: Control:
2994 12/04/2014 12/04/2014 ASP.NET MVC Button
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.