Hi. I am new in this group.
I am having a problem with AJAX with ASP.NET (both Framework 1.1 and
2.0)
I have some custom controls (such a Grid) that uses reflection to
get data form buness objects (such as the ObjectdataSource does, but
this is my implementation).
When it finishes rendering all contents, it stores it self in
session to be retreived in later AJAX refresh calls.
AJAX calls (which code I paste below) calls a "GridRemote.aspx" page
that gets the parameters to retreive the grid from session, then
render it, and finally returns the contents to be returned by the
ajax call. Then a JS function replaces the grid code with the new
one and that's it... magic is done ;-)
The problem is that after certain time or after several calls (I am
not sure which events starts producing the error. Surely the time
the most cases) I receive an empty AJAX response. Every other AJAX
call behaves the same after that.
Debugging Javascript, the call is made ok. I get the 4 redystate and
the 200 request status, but the responsetext is '' nothing...
Debugging ASP.NET, the AJAX request is detected in global.asax, but
no other code is executed. Neither the GridRemote.aspx Sub New, nor
any other peace of code (that's why AJAX gets nothing).
Afer refreshing the whole page, I check the session Id and it's the
same... so... no wonder what's going on...
The only action that fix this situation y restarting IIS.
żAny help please?
Thanks
AJAX Code:
Ajax.getDataReturnText = function(url, callback)
{
var XMLHttpRequestObject = false;
if (window.XMLHttpRequest)
{
XMLHttpRequestObject = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}
if(XMLHttpRequestObject)
{
XMLHttpRequestObject.open("GET", url, true);
XMLHttpRequestObject.onreadystatechange = function()
{
if (XMLHttpRequestObject.readyState == 4 &&
XMLHttpRequestObject.status == 200)
{
callback(XMLHttpRequestObject.responseText);
delete XMLHttpRequestObject;
XMLHttpRequestObject = null;
}
}
XMLHttpRequestObject.send(null);
}
}