Harish Batchu

Harish Batchu

  • NA
  • 255
  • 71.3k

error 404 error

Oct 16 2018 1:21 AM
<script>
$(function () {
$("#loginbtn").click(function () {
var obj = {};
alert("hii");
obj.name = $.trim($("#username1").val());
obj.age = $.trim($("#password1").val());
$.ajax({
type: "POST",
url: "Incomeexpenses.aspx/SendParameters",
data: JSON.stringify(obj),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
alert(r.d);
}
});
return false;
});
});
</script>
 
 
 
in cs file i have this method
 
[WebMethod]
public static void SendParameters(string uname, string password)
{
}
}
 
 
it show like error

?
jquery.min.js:4 POST http://localhost:64712/Incomeexpenses.aspx/SendParameters 401 (Unauthorized)
 
 
 

Answers (4)