How To Call Controllers Method Using J Query
I Have Tried This Code
View
function wronguser() {
debugger;
var obj = {};
$.ajax({
async: false,
type: "POST",
url: "Login/Cancel",
data: JSON.stringify(obj),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
debugger;
alert("Success");
},
error: function () {
alert("Failed to load ...!!!");
}
});
}
Controller
[HttpPost]
public ActionResult Cancel()
{
return RedirectToAction("PageTwo", "MainPage");
}

Yogesh GhorpadePosted Mar 16, 2018, 12:56 AM
Brajesh KumarPosted Mar 15, 2018, 9:05 AM