i am new to C# , and i created a sample website which will use a REST Service for login , for that i am calling the service by ajax call in j query , so i have two problems , one is the ajax call is not at all hitting the service and another is the code which i wrote for page relocation (window.location.href="sample";) is not working , the code is as fallows .
What I have tried:
$(document).ready(function () {
debugger;
$("#ContentPlaceHolder1_btnSubmit").click(function () {
debugger;
var obj = new Object();
obj.UserID = $('#ContentPlaceHolder1_txtUserid').val();
obj.Password = $('#ContentPlaceHolder1_txtPassword').val();
debugger;
$.ajax({
type: 'POST',
url: "http://192.168.124.69:447/api/AFSService/checkLogin/",
//headers: {
// "$Access-Control-Allow-Headers": "X-Requested-With"
//},
crossDomain: false,
data: obj,
async: false,
contentType: "application/json; charset=utf-8",
dataType: 'json',
success: function (result) {
debugger;
alert('success');
debugger;
window.location.replace = "http://localhost:50990/Jobs.aspx";
//return Json(new { Url : "http://localhost:50990/Jobs.aspx"})
//$json['redirect'] = "http://localhost:50990/Jobs.aspx";
//window.navigate("http://localhost:50990/Jobs.aspx")
//window.location.href="http://localhost:50990/Jobs.aspx";
// top.location.href= "D:\Home.html";
},
error: function (data) {
debugger;
alert('enter the proper credentials');
debugger;
//window.location.href = "http://localhost:50990/Jobs.aspx";
window.location.href = "http://localhost:50990/Jobs.aspx";
}
});
});
});