This is a migrated thread and some comments may be shown as answers.

AjaxRequest event for AjaxManagerProxy

3 Answers 282 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
MB
Top achievements
Rank 1
MB asked on 20 Sep 2007, 02:58 AM
The Prometheus AjaxManagerProxy has no support for an AjaxRequest EventHandler, which I find makes it awkward to use in dynamically created UserControls, where I am constructing everything programmatically, and want to be able to manage the AjaxRequest event at the UserControl itself.

This is easy to do with the RadAjaxManager... just add the AjaxManager to the UserControl and give it a AjaxRequest delegate... but, of course, you can't do this with Prometheus (where you can only have the one AjaxManager) and so perhaps a similar functionality with the Prometheus AjaxManagerProxy to emulate this might be work looking at ??

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Sep 2007, 07:01 AM
Hi MB,

You can easily find the manager and subscribe to AjaxRequest event. Here is an example:
RadAjaxManager.GetCurrent(Page).AjaxRequest += ...

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
MB
Top achievements
Rank 1
answered on 20 Sep 2007, 07:34 AM
Hi,

I recall having this conversation recently with Telerik in a support ticket, where I was actually doing exactly that (and having problems) and the upshot was that I was advised NOT to subscribe custom delegates to the AjaxManager, and to use RadAjaxManager as the Prometheus AjaxManagerProxy didn't support AjaxRequest eventhandlers.

Can I assume from your comment that it's now OK to subscribe multiple delegates to the AjaxRequest event of the AjaxManager ?? Without it, it's near impossible to manage the events at the UserControl level, which is why I reverted to the RadAjaxManager.

Of course, all delegates events are going to fire on an AjaxRequest() from the client... but I guess the is no way to control that from the client ?
0
plamen
Top achievements
Rank 1
answered on 21 Sep 2007, 11:25 AM
hi


I have read the documentation and I understand that I can get the manager by RadAjaxManager.GetCurrent() method and subscribe for its events. The method will return null if there is no manager on the page, similar to ASP:ScriptManager implementation.

"4) Only one instance of RadAjaxManager control is supported

The previous limitation of single RadAjaxManager per naming container is extended so that now there should be only one instance of the control on the whole page. This means that you cannot have one manager on the main page containing a user control and another inside the user control itself (or Master and content page). Otherwise an error is thrown.

Instead, having a manager instance on the main page/MasterPage, one can already add a RadAjaxManagerProxy in the user control/content page. The Proxy control purpose is similar to the one of ScriptManagerProxy and it could be used to add the necessary settings design-time within the user control/content page, instead of adding them programmatically finding the manager from the main page/master page.

Additionally, if one still needs the manager instance at the code of a WebUserControl for example, she can get the manager by RadAjaxManager.GetCurrent() method call. The method will return null if there is no manager on the page, similar to ASP:ScriptManager implementation."

About your second question, please review this online demo :)


Cheers...
[John Peel]
Tags
Ajax
Asked by
MB
Top achievements
Rank 1
Answers by
Vlad
Telerik team
MB
Top achievements
Rank 1
plamen
Top achievements
Rank 1
Share this question
or