Hi,
I currently fight with a problem handling RadFileExplorer.
While there are other problems it brings me to a general question - is there a need to serialize ajax calls.
I use sample code from RadFileExplorer - but the question is a general question.
Assume this OnClientSomeControlDidSomething is fired by a control which fires this event immediately after it fired an ajax call.
As with FileExplorer - it fires something like "AjaxLoadTheFolderContent" followed by OnClientFolderChange.
So if loading of the changed folder takes time my handler starts an ajax call while an other ajax call (LoadFolderContent) is in progress.
So the general question - does it make problems (or is it even allowed) to make an ajax call while another ajax call is in progress?
I'm not talking about potential problems (who wins if controls need to be updated) - I just wanna know if this is allowed or not.
If the answer is: NO it is not allowed you have to make the calls one after another if have a second problem.
OnResponseEnd and OnRequestStart are two functions available on the AjaxManager. But there is no "extra version" for the AjaxProxy.
Assume I have to serialize calls and I use MasterPages where the AjaxManager resides in the masterpage while AjaxProxies are used in the DetailPages - and to make it really hard - I use UserControls - also with AjaxProxy.
Assume further the MasterPage has a need to handle the OnResponseEnd - my page needs special handling also and finally my UserControl has a need for those events.
Since these eventhandler are not events like C# events where I add a handler (additional to existing ones) I can only have one of these handlers at a time.
Of course I could do some "Magic" by finding out if an event is already bound and then emit my handler jscript from server like this:
As long as I take care about my Handler function name it should work - but is this a good solution, or is there a "how to do this properly" for "chaining" handlers?
Regards
Manfred
I currently fight with a problem handling RadFileExplorer.
While there are other problems it brings me to a general question - is there a need to serialize ajax calls.
I use sample code from RadFileExplorer - but the question is a general question.
function OnClientSomeControlDidSomething(sender, args) { |
TellServerAboutSelectedElement("Someparam"); |
} |
function TellServerAboutSelectedElement(argument) { |
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); |
ajaxManager.ajaxRequest(argument); |
} |
As with FileExplorer - it fires something like "AjaxLoadTheFolderContent" followed by OnClientFolderChange.
So if loading of the changed folder takes time my handler starts an ajax call while an other ajax call (LoadFolderContent) is in progress.
So the general question - does it make problems (or is it even allowed) to make an ajax call while another ajax call is in progress?
I'm not talking about potential problems (who wins if controls need to be updated) - I just wanna know if this is allowed or not.
If the answer is: NO it is not allowed you have to make the calls one after another if have a second problem.
OnResponseEnd and OnRequestStart are two functions available on the AjaxManager. But there is no "extra version" for the AjaxProxy.
Assume I have to serialize calls and I use MasterPages where the AjaxManager resides in the masterpage while AjaxProxies are used in the DetailPages - and to make it really hard - I use UserControls - also with AjaxProxy.
Assume further the MasterPage has a need to handle the OnResponseEnd - my page needs special handling also and finally my UserControl has a need for those events.
Since these eventhandler are not events like C# events where I add a handler (additional to existing ones) I can only have one of these handlers at a time.
Of course I could do some "Magic" by finding out if an event is already bound and then emit my handler jscript from server like this:
string strExistingHanlder = aM.ClientEvents.OnResponseEnd; |
string strMyHandler; |
if (!string.IsNullOrEmpty(strExistingHanlder)) { |
strMyHandler = "function OnMyResponseEnd(sender,args) {"; |
strMyHandler += strExistingHanlder + "(sender, args); DoMyHandling(sender, args); }"; |
} |
else { |
strMyHandler = "function OnMyResponseEnd(sender,args) { DoMyHandling(sender, args); }"; |
} |
Regards
Manfred