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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to make a button with @ Html.ActionLink?

Thread ID:





117267 Sep 19,2014 11:08 AM UTC Sep 24,2014 04:08 AM UTC ASP.NET MVC 3
Tags: Button
ezequie da silva daniel
Asked On September 19, 2014 11:08 AM UTC


I've read the manual several times, I searched in google, Syncfusion the site and could not make a Html.ActionLink work with the button, calling the controller can give me an example?

Saranya Sivakumar [Syncfusion]
Replied On September 23, 2014 09:25 AM UTC

Hi Ezequie,

We would like to let you know that, we cannot directly make the Html.ActionLink to work using button. Since Html.ActionLink returns the anchor tag. So we have to customize CSS style to the anchor tag to look like a button. Else we have to use “@Url.Action(“actionName”,”controllerName”)” in order to redirect to the view page. Both Html.ActionLink and Url.Action will works similarly. Hence we can use Url.Action instead of Html.ActionLink. For your convenience we have prepared the sample based on your requirement. Please download the same in the following location.

Sample Location: Sample

In the above sample we have created the button and binded the click event in the script section. In the click event we have given the Url.Action to redirect to the view page. Please find the following code snippet for more reference.

We have created the button in CSHTML page as follows.


<button id="button1">



We have initialized the Button and Url.Action in the script section as follows.


<script type="text/javascript">

    $(document).ready(function () {


            "click": "onclick",

            text: "Click Here"



    function onclick() {

        document.location = '@Url.Action("Index","Home")';



Please let us know if you have further concern.



ezequie da silva daniel
Replied On September 23, 2014 12:05 PM UTC

Ok, Thanks, solved! 



Saranya Sivakumar [Syncfusion]
Replied On September 24, 2014 04:08 AM UTC

Hi Ezequie,

Thanks for your update.

Please get back to us if you have further concern, we will be happy to help you out.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon