I'm making a simple call to a Webmethod (Pagemethod), but I keep getting this error:
[object XMLHttpRequest]
Javascript:
var id = $('#' + this.Div).attr('id');
var test = $('#' + id).parent('.Prod-top-time').prev().attr('id');
test = test.replace('navn_', '');
var parameters = {'auktionid': test};
$.ajax({
type: "POST",
url: "Default.aspx/AuctionEnd",
data: JSON.stringify(parameters),
//data: JSON.stringify({ auktionid: 34}),
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function(ret)
{
if (ret.hasOwnProperty('d'))
stuff(ret.d);
else
stuff(ret);
}
});
function stuff(msg) {
alert(msg);
}
In the first part, I extract a value from a div id. This is a number used as parameter.
The Webmethod is as simple as this: (Just for testing so far)
[WebMethod]
public static string AuctionEnd(int auktionid)
{
return auktionid.ToString();
}
No matter what I throw at it, it returnes that error.