var url = '@Url.Action("Delete")';
$.ajax({
url: url,
async: false,
data: {id:clientId},// have also tried data:clientId and data:[clientId]
type: 'POST',
});
는 구현 간다
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script>
function submitForm() {
var model = new Object();
model.Name = "Rami";
jQuery.ajax({
type: "POST",
url: "@Url.Action("Delete")",
dataType: "json",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ id: model.Name }),
success: function (data) { alert(data); },
failure: function (errMsg) {
alert(errMsg);
}
});
}
</script>
<input type="button" value="Click" onclick="submitForm()"/>
코드를 실행
-
고맙습니다. –