AjaxRequest event for AjaxManagerProxy

4 posts, 0 answers
  1. MB
    MB avatar
    149 posts
    Member since:
    Jan 2005

    Posted 19 Sep 2007 Link to this post

    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 ??
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 20 Sep 2007 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. MB
    MB avatar
    149 posts
    Member since:
    Jan 2005

    Posted 20 Sep 2007 Link to this post

    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 ?
  5. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 21 Sep 2007 Link to this post

    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]
Back to Top