When User Submit user is admin to redirect another page:
$("#btnSubmit1").click(function () {
var u = $('#UserName').val();
var p = $('#Password').val();
$.ajax({
url: '@Url.Action("UserLogin", "Home")',//userLogin is Action result of controller,Home is controller
data: { "username": u, "password": p },
type: 'POST',
dataType: 'json',
success: function (response) {
data = response.Data;
alert(response);
if (response == "admin") {
location.href = "../School/SchoolSerch";
}
else {
//If data is null the we are removing the li and ul elements.
}
},
error: function (xhr, status, error) {
}
});
$("#btnSubmit1").click(function () {
var u = $('#UserName').val();
var p = $('#Password').val();
$.ajax({
url: '@Url.Action("UserLogin", "Home")',//userLogin is Action result of controller,Home is controller
data: { "username": u, "password": p },
type: 'POST',
dataType: 'json',
success: function (response) {
data = response.Data;
alert(response);
if (response == "admin") {
location.href = "../School/SchoolSerch";
}
else {
//If data is null the we are removing the li and ul elements.
}
},
error: function (xhr, status, error) {
}
});
Sign up here with your email
ConversionConversion EmoticonEmoticon