Control gets ajaxified without intent

5 posts, 0 answers
  1. Markus
    Markus avatar
    103 posts
    Member since:
    Dec 2007

    Posted 18 Aug 2008 Link to this post

    Hello!

    I have a user control that searches recursively for an radajaxmanger in its page hierarchy. Then the control adds its components that should be ajaxified like that:

    ajaxManager.AjaxSettings.AddAjaxSetting(btnEditValues, gridPanel, radLoadingPanel);

    the page hierarchy looks like that

    Page (with the Ajax Manager)
    -Control
    --gridPanel
    ---btnEditValues

    Now every control in the gridPanel makes an ajaxpostback as well.
    When I try to exclude the control from the AjaxRequest with a javascript (OnRequestStart for example) the Clientside event "OnRequestStart" is not even called. But still an ajax postback is made.

    I successfully excluded other controls from the postback, like "btnEditValues".

    Is it possible that control that are the updated ones a somehow implicitly the updating ones as well ??

    I'm really stuck here...

    thx in advance for your help,

    kind regards,
     M
  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 18 Aug 2008 Link to this post

    Hi Markus,

    Indeed, this is the default behavior of RadAjaxManager. Here is how to disable AJAX requests from child controls:

    http://www.telerik.com/help/aspnet-ajax/ajxexclude.html


    Sincerely yours,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Markus
    Markus avatar
    103 posts
    Member since:
    Dec 2007

    Posted 18 Aug 2008 Link to this post

    Hi Dimo,

    It's the default behaviour that a control that becomes the updated control becomes the updating control as well??

    anyway, if this behaviour is expected, I wonder why I don't reacht the OnRequestStart event of the RadAjaxManager if one of the originally updated controls initializes an ajax postback.

    I had to had the gridPanel as updating control and then I get into the OnRequestStart eventhandler. This is one more workaround I don't like...
    Is it expected?

    kind regards
  5. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 18 Aug 2008 Link to this post

    Hi Markus,

    I misunderstood your question, sorry about that.

    Anyway, the observed behavior is caused by the MS AJAX framework. Here is the workaround:


    1) First, you need to ajaxify the gridPanel like this:

    ajaxManager.AjaxSettings.AddAjaxSetting(gridPanel, gridPanel, radLoadingPanel);


    Now the OnRequestStart event will be fired for all AJAX request. From this point:


    2) Check the event target in the OnRequestStart event handler and cancel the AJAX request if the event target is not
    btnEditValues:


        function RequestStart(sender, args)
        {
            if (args.get_eventTarget().indexOf("
    btnEditValues") == -1)
            {
                args.set_enableAjax(false);
            }
        }



    Greetings,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Steven
    Steven avatar
    4 posts
    Member since:
    May 2013

    Posted 22 Sep 2014 Link to this post

    This line:

    ajaxManager.AjaxSettings.AddAjaxSetting(gridPanel, gridPanel, radLoadingPanel);

    Resolved an issue for me where the ajaxRequestStart and ajaxRequestEnd client side events of RadAjaxManager were not being fired for a RadListView control within a user control where a panel on the parent page was ajaxified.

    Masterpage
    > Page
    >> Panel (Ajax Updated Control)
    >>> UserControl
    >>>> RadListView (Ajax initiator/updated control)

    The trick was to make the Panel an Ajax Initiator also. Then the client events began to fire.





Back to Top
UI for ASP.NET Ajax is Ready for VS 2017