I am calling below javascript method from code behind then, why does [Object XMLHttpReequest] Message come?
function SendMsg() { var user = document.getElementById('<%=User.ClientID %>'); var val = user.value; var nonrno = 1234; var rno = 123;
var options = { type: "POST", url: "Test.aspx/SendMessage", data: "{'toMailAddress':'" + val + "','rno':'" + rno+ "', 'nonrno':'" + nonrno+ "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { var val1 = response.d; alert(val1); if (val1 == "1") { // Below code is used to close the window, if message has been sent to the user sucessfully. var windowObj = window.self; windowObj.opener = window.self; windowObj.close(); } }, error: function (result) { alert("Error in " + result); } }; //Call the PageMethods $.ajax(options); }