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

Disable controls during ajax

1 Answer 88 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Cal
Top achievements
Rank 1
Cal asked on 09 Nov 2010, 07:10 PM
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

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 10 Nov 2010, 10:42 AM
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
Tags
Ajax
Asked by
Cal
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or