---
title: "Making a Simple Ajax call to controller in asp.net mvc on button click"  
description: "Making a Simple Ajax call to controller in asp.net mvc on button click"  
author: "Samuel Fernandes"  
published: 2017-12-06  
updated: 2017-12-07  
canonical: https://www.mindstick.com/forum/34381/making-a-simple-ajax-call-to-controller-in-asp-dot-net-mvc-on-button-click  
category: "asp.net"  
tags: ["ajax", "jquery", "asp.net mvc", "mvc"]  
reading_time: 2 minutes  

---

# Making a Simple Ajax call to controller in asp.net mvc on button click

I [am unable](https://answers.mindstick.com/qa/95314/how-do-i-access-a-group-link-in-telegram-if-i-am-unable-to-access-the-link) to send [ajax request](https://www.mindstick.com/forum/157891/what-is-the-role-of-the-jsonresult-class-in-mvc-how-can-it-use-to-return-data-to-an-ajax-request) to [controller action](https://www.mindstick.com/forum/34400/how-to-retrieve-form-values-in-controller-action). I think i am [missing](https://answers.mindstick.com/qa/52138/international-missing-children-s-day-2019-was-observed-on) 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>
```

\

## Replies

### Reply by Manish Kumar

try this code..

```
<script>    $(document).ready(function () {        $("#tarticle").on("click", function () {
            $.ajax({                url: '@Url.Action("article", "Home", new { @type = "articles" })',                type: "GET",                success: function (data) {                    alert(data);
                }
            })
        });
</script>
```

hope this helps you..


---

Original Source: https://www.mindstick.com/forum/34381/making-a-simple-ajax-call-to-controller-in-asp-dot-net-mvc-on-button-click

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
