Disable controls during ajax

2 posts, 0 answers
  1. Cal
    Cal avatar
    4 posts
    Member since:
    Oct 2010

    Posted 09 Nov 2010 Link to this post

    Hello,
      Forgive me as this may seem like a newbie question, I'm trying to do a simple operation of disabling a control (asp.net Button) during an Ajax operation based on this article:
    http://www.telerik.com/help/aspnet-ajax/ajxdisablecontrolsduringajax.html
    The structure I have as follow

    WebUserControl:
    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
    <telerik:AjaxSetting AjaxControlID="btnFilter">
    <AjaxSettings>
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdReport" LoadingPanelID="RadAjaxLoadingPanel1"
                        UpdatePanelHeight="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
       </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    Master page

    Masterpage:
    <script type="text/javascript">
        function RequestStart(sender, args) {
    <script type="text/javascript">
           
    function RequestStart(sender, args)
           {
              
    args.EventTargetElement.disabled = true;
           }
           
    function ResponseEnd(sender, args)
           {
               
    args.EventTargetElement.disabled = false;
           }
    </script>

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
         <telerik:RadAjaxManager id="RadAjaxManager1" runat="server">
          <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
         </telerik:RadAjaxManager>

    Now, args.EventTargetElement is always coming as null, I tried placing the script in the usercontrol but that didn't make a difference.  Can you please help?

    Regards,
    Cal
  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 10 Nov 2010 Link to this post

    Hello Cal,

    Should you need the server or client-side RadAjaxManager functionality (like ResponseScripts collection, ajaxRequest function) you can get the "master" manager instance via Server-Side GetCurrent method from the user control code-behind. Please refer to the help articles below for more information:
    RadAjax and WebUserControls
    AJAX Manager Proxy

    I hope this helps.

    All the best,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top