ajaxでmvcコントローラーを使用しています。jquery 確認ボックスを使用してタスクを実行します。「OK」ボタンをクリックすると、別のajaxと別のコントローラーへのリンクを呼び出す必要がありますが、機能しません
サンプルコード:
function button_click() {
$.ajax({
type: 'POST',
url: 'url',
data: {data},
dataType: 'json',
success: function (data) {
if (data.success == true) { call(data); }
else { alert(data.data); }
}
});
}
function call(data)
{
var ans = confirm(data)
if(ans)
{
$.ajax({
type: 'POST',
url: '@(Url.Action("StudentList", new { Area = "Mec", Controller = "HOD" }))',, // this url not goes to the controller
data: {data},
dataType: 'json',
success: function (data) {
if (data.success == true) { alert(data.data); }
else { }
}
});
} else { }
}