forum

Home / DeveloperSection / Forums / Making a Simple Ajax call to controller in asp.net mvc on button click

Making a Simple Ajax call to controller in asp.net mvc on button click

Samuel Fernandes 1316 06-Dec-2017

I am unable to send ajax request to controller action. I think i am missing something ..

<script type="text/javascript">

    $('#UseShipAddr').click(function () {
        $.ajax({
            url: "@(Url.Action("article", "Home"))",
            type: "POST",
            data: { id: 50 },
            cache: false,
            async: true,
            success: function (data) {
                alert(data);
            }
        });
    });
</script>



Updated on 07-Dec-2017

Can you answer this question?


Answer

1 Answers

Liked By