使用ajax的呼叫控制器

hey every one i want to call controller action using ajax. but its gives an error. "resource cannot be found". javascript function call successfully controller action is not call

here is my view code:

<a class="btn btn-primary" onclick="EditUser('Delete', 'Users', '@Model.Items.ElementAt(i).ID');">Link</a>



 function EditUser(action, controller, id)
            {

                alert(action);
                alert(controller);
                alert(id);

                $.ajax({
                    type: "POST",
                    url: '@Url.Action("Edit", "Users")',
                    data: "{ id: '" + id + "'}",
                    success: function (response) {
                    if (response.d != '1') {
                        alert('Not Saved!');
                    }
                    },
                    error: function (response) {
                    if (response.responseText != "") {
                         alert(response.responseText);
                         alert("Some thing wrong..");
                       }
                   }
                 });
            }

and here is my controller action.

public override ActionResult Edit(int id = 0)
        {
    int a = id;
     return View("Edit", DTO);
    }
<div id='Sample'></div>
Modify your Ajax function as below.
$.ajax({
            type: "POST",
            url: '@Url.Action("Edit", "Users")',
            data: { id: id },
            success: function (response) {
            $('#Sample').html(response);
            },
            error: function (response) {
            if (response.responseText != "") {
                 alert(response.responseText);
                 alert("Some thing wrong..");
               }
           }
         });

[HttpPost]
public override ActionResult Edit(int id = 0)
    {
int a = id;
 return PartialView("Edit",dto);
}

if you are specifying the Ajax type as post make sure to add
[HttpPost] attribute in controller action.