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

ResponseScripts.Add cannot work with RadAjaxManager

1 Answer 8 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Sachita
Top achievements
Rank 1
Iron
Iron
Iron
Sachita asked on 24 Mar 2021, 06:05 AM

<INPUT onclick="javascript:setTimeout('window['Control_RadAjaxManager'].AsyncRequest(\'Control$ShareRadioButton\',\'\')', 0)" 

Code Snippet:
private void AddAjaxResponseScripts()
        {
            this.RadAjaxManager.ResponseScripts.Add("Sample.Controls.init(); if(Sample.QueryAddEdit) { Sample.AddEdit.init(); } ");
        }
Here Escape characters are not getting loaded properly .Missing  Escape characters in window['Control_RadAjaxManager'].
Current Version of Telerik 2015.3.1111.35 with .NetFramework 4.8.

Can anyone please help on this issue?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 26 Mar 2021, 10:01 AM

Hi Kumar,

You can try to escape the single quotes like this javascript:setTimeout('window[\'Control_RadAjaxManager\']

Note that the proper way to get reference to the RadAjax control is via the MS AJAX method: $find

$find("<%= RadAjaxManager1.ClientID %>");

as explained in this article https://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/client-side-programming/overview#ajaxrequest-event

The other ways of obtaining a reference are discussed at Get Client-side Reference to a Control Object.

Regards,
Rumen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Ajax
Asked by
Sachita
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Rumen
Telerik team
Share this question
or