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

How to set Client Events on RadAjaxManager programmatically?

2 Answers 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Darius
Top achievements
Rank 1
Darius asked on 08 Jan 2018, 09:05 PM

Hi, I am trying to set the OnRequestStart client event of RadAjaxManager from server side. I tried this code, but it's not firing the event:

RadAjaxManager.GetCurrent(Page).ClientEvents.OnRequestStart = "mngRequestStarted";

I am ajaxifying the control properly with:

<telerik:RadAjaxManager ID="MasterAjaxManager" runat="server">
<AjaxSettings>
     <telerik:AjaxSetting AjaxControlID="MasterAjaxManager">
<UpdatedControls>
     <telerik:AjaxUpdatedControl ControlID="grdTest" />
 
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

2 Answers, 1 is accepted

Sort by
0
Darius
Top achievements
Rank 1
answered on 08 Jan 2018, 09:07 PM

function mngRequestStarted(ajaxManager, eventArgs)
{

//this Is never getting called
      alert("eventFired");

0
Rumen
Telerik team
answered on 09 Jan 2018, 06:24 AM
Hello,

Try to place the JavaScript function inside telerik:RadScriptBlock tags:

<telerik:RadScriptBlock  ID="RadScriptBlock1" runat="server">
function mngRequestStarted(ajaxManager, eventArgs) {
      alert("eventFired");

</telerik:RadScriptBlock >

Check this article for more information: https://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/radcodeblock-and-radscriptblock.

Also try to put the script on the page with the RadAjaxManager on it.

Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Darius
Top achievements
Rank 1
Answers by
Darius
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or