Hi!
Im trying do a ajax request with the ajaxmanager from a callback function, but the ajaxmanager is null when called form the callback. A simple test can be made.
Do the request, in the callback handler do another request as follow:
| function PressMe() |
| { |
| SendRequest("From Press Me"); |
| } |
| |
| function SendRequest(message) |
| { |
| var ajaxManager = $find("RadAjaxManager1"); |
| ajaxManager.ajaxRequest(message); |
| } |
| |
| function RequestCallback() |
| { |
| //setTimeout("SendRequest('From Callback');",0); |
| SendRequest("From Callback"); |
}
|
The first time the 'SendRequest' is called it finds the ajaxManager and does the request. Then the RequestCallBack is called from the server-side :
| protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) |
{
|
| RadAjaxManager1.ResponseScripts.Add("RequestCallback();"); |
| } |
It adds the script and calls the client-side 'RequestCallback' funtion and sends now the second request, but this time the ajaxaManager object is null!
The intresting fact is that if I do a time out with 0 milisecond wait ( commentded code ) it finds the ajaxManager.
Maybe something with the context of this ResponseScripts? Any ideas?
Thanks.