Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

ajax in js file returns error for asp.net WebMethod

$
0
0

Hi

i use  below ajax in a js file 

$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "NewHere.aspx/BindDatatable",

data: "{}",
dataType: "json",
success: function(data) {
var theHtml = data.d;
// alert(data.d);
window.location.href = data.d;
},
error: function(result) {
alert("Error is " + result.value);
}
});

and in NewHere.aspx , i have [WebMethod]

but it gives error 

Error is undefined..

also it does not call funtion WebMethod

pls advice issue (is it because i use ajax post in separate js file)


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>