G
George
I am doing an AJAX call using JQuery on my page to [WebMethod] which returns
JSON objects and everything works fine.
Now I decided to use ashx handler instead of [WebMethod] and simply write
JSON out. Then my problems begun.
So here is JQuery call
$.ajax({
type: 'POST',
url: url,
data: '{id:5}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function(result) { ...},
error: function() {... }
});
If url = "Default.aspx/Remove" wich is WebMethod it works perfectly
If url = "ServiceCalls.ashx/Fetch" then the call fails with an error 12030
which is comes from IE's XMLHttpRequest object and stand for
"The connection with the server has been reset or terminated"
Here are strange things.
1. It works in FireFox. Only IE has a problem
2. If i try to debug application it works.
3. If i have a Fiddler running it works.
I tried to analyze with Fiddler 2 requests (and replies) to
"Default.aspx/Remove" and to "ServiceCalls.ashx/Fetch" and they look
absolutely identical.
I rulled out that i output incorrect JSON since it works with Fiddler in IE
and with FireFox.
So I am completely puzzled. What does [WebMethod] does differently?
Thanks
George.
JSON objects and everything works fine.
Now I decided to use ashx handler instead of [WebMethod] and simply write
JSON out. Then my problems begun.
So here is JQuery call
$.ajax({
type: 'POST',
url: url,
data: '{id:5}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function(result) { ...},
error: function() {... }
});
If url = "Default.aspx/Remove" wich is WebMethod it works perfectly
If url = "ServiceCalls.ashx/Fetch" then the call fails with an error 12030
which is comes from IE's XMLHttpRequest object and stand for
"The connection with the server has been reset or terminated"
Here are strange things.
1. It works in FireFox. Only IE has a problem
2. If i try to debug application it works.
3. If i have a Fiddler running it works.
I tried to analyze with Fiddler 2 requests (and replies) to
"Default.aspx/Remove" and to "ServiceCalls.ashx/Fetch" and they look
absolutely identical.
I rulled out that i output incorrect JSON since it works with Fiddler in IE
and with FireFox.
So I am completely puzzled. What does [WebMethod] does differently?
Thanks
George.