Assign ActionLink to jQuery button in MVC

asp.net-mvc, asp.net-mvc-3, c#, javascript, jquery

Solution

Based on your comments, you just want to go to the About action in the Home controller on button click, you can do the following and remove the `ActionLink`:

$(function () {
    $("#Button1").click(function () {
        location.href = '<%= Url.Action("About", "Home") %>';
    });
});

Problem

How do I assign ActionLink to a jQuery button in asp.net MVC page. ``` <button id="Button1">Click</button> <%: Html.ActionLink("About", "About", "Home")%> <script language="javascript" type="text/javascript"> $(function () { $("#Button1").button().click(function () { return false; }); }); </script> ```

Original source