XmlHttpRequest seems to cause problems with RadGrids when using a RadAjaxManager.
We are building a Website that has a few RadGrids and a RadAjaxManager.
Also on the page there is a client side timer initiated using window.setTimeOut() set to trigger every 15 seconds.
The event for the timer triggers an Asynchronous XmlHttpRequest using:
It then recieves this in a client side event, parses the XML and displays the content using javascript.
This functionality all works fine but the problem is that introducing this code seems to cause strange behaviour on RadGrids. After the page has been running for a while, clicking on the radgrid will cause all it's data to disappear and postbacks seem to have completely lost their viewstate.
If I remove my XmlHttpRequest call then the RadGrids behave fine.
Are the RadAjaxManager and RadGrids compatible with the use Asynchrous Requests as described above? and does anyone have any ideas why an XmlHttpRequest would cause this problem?
We are building a Website that has a few RadGrids and a RadAjaxManager.
Also on the page there is a client side timer initiated using window.setTimeOut() set to trigger every 15 seconds.
The event for the timer triggers an Asynchronous XmlHttpRequest using:
| function SendRequest(url, CallbackFunc, send) |
| { |
| var req = GetRequest(); |
| req.open("Post", url, true); |
| req.send(send); |
| req.onreadystatechange = |
| function() |
| { |
| if (req.readyState != 4) return; |
| if (req.status != 200) return; |
| CallbackFunc(); |
| }; |
| } |
| function GetRequest() |
| { |
| var req = false; |
| if (window.XMLHttpRequest && !(window.ActiveXObject)) |
| { |
| try |
| { |
| req = new XMLHttpRequest(); |
| } |
| catch (e) |
| { |
| req = false; |
| } |
| } |
| else if (window.ActiveXObject) |
| { |
| try |
| { |
| req = new ActiveXObject("Msxml2.XMLHTTP"); |
| } |
| catch (e) |
| { |
| try |
| { |
| req = new ActiveXObject("Microsoft.XMLHTTP"); |
| } |
| catch (e) |
| { |
| alert("Your browser does not support AJAX!"); |
| req = false; |
| } |
| } |
| } |
| return req; |
| } |
Then Sever side it generates an XML formatted string which it returns using:
Response.Write( MyXmlString);
It then recieves this in a client side event, parses the XML and displays the content using javascript.
This functionality all works fine but the problem is that introducing this code seems to cause strange behaviour on RadGrids. After the page has been running for a while, clicking on the radgrid will cause all it's data to disappear and postbacks seem to have completely lost their viewstate.
If I remove my XmlHttpRequest call then the RadGrids behave fine.
Are the RadAjaxManager and RadGrids compatible with the use Asynchrous Requests as described above? and does anyone have any ideas why an XmlHttpRequest would cause this problem?