I have ajax.net2 version 1.8.1.0. I want use to this on my asp.net 4.0 site. It work fine with other controls but when I use this with dropdown list I get JS error. Reason it convert ' to '. How can I fix this?
<select name="ctl00$PageContentPlaceHolder$PageGrid$ctl01$ctl03$ctl01$PageDropDownList" onchange="javascript:setTimeout('AjaxNS.AR(\'ctl00$PageContentPlaceHolder$PageGrid$ctl01$ctl03$ctl01$PageDropDownList\',\'\', 'ctl00_PageContentPlaceHolder_RadAjaxManager1', event)', 0)" id="ctl00_PageContentPlaceHolder_PageGrid_ctl01_ctl03_ctl01_PageDropDownList" class="csa_textbox" style="width:40px;">
24 Answers, 1 is accepted
Could you please elaborate a bit more on your application? What exactly scenario you are trying to achieve? Please provide us the RadAjax settings you have in the project and all related to the issue code behind so we could further research on the problem.
Best wishes,
Maria Ilieva
the Telerik team
Could you please elaborate a bit more on your application? What exactly scenario you are trying to achieve? Please provide us the RadAjax settings you have in the project and all related to the issue code behind so we could further research on the problem.
Best wishes,
Maria Ilieva
the Telerik team

When the application is run in .Net 4 mode the AJAX output get scrambled for RadioButtonList.
The control is ajaxified in code behind (ajaxManager.AjaxSettings.AddAjaxSetting)
I reely hope there is some more info or solution on this problem.
Render on .Net 4
javascript:setTimeout('AjaxNS.AR(\'
Render on .Net 2
javascript:setTimeout('AjaxNS.AR(\'
Could you please let me know if the error appears when simple asp UpdatePanel is used instead of RadAjaxManager?
We are not aware of such generic issue with our RadAjax so more information on the scenario in which the problem persists could further help us investigate on the issue.
Best wishes,
Maria Ilieva
the Telerik team

I think the problem is related to the new Ajax Toolkit (new System.Web.Extensions.dll and AjaxControlToolkit.dll)
So the problem doesent seems to be with Frame Work 4 itself.

Render on .Net 4
javascript:setTimeout('AjaxNS.AR(\'
Render on .Net 2
javascript:setTimeout('AjaxNS.AR(\'
We recently upgraded the website to .NET 4.0 and we do encounter these errors. I do appreciate your prompt reply.
Thanks,
-Rajiv
We are not aware of such an issue and were not able to replicate it on our side. Could you please open a regular support ticket and send us runnable version of your application and exact steps for replicating the issue. Thus e will be able to test it locally and do our best to help.
All the best,
Maria Ilieva
the Telerik team

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; chromeframe/10.0.648.133; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC EA 2; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC LM 8; AskTbGOM2/5.9.1.14019)
Timestamp: Thu, 23 Dec 2010 23:13:02 UTC
Message: Expected ')'
Line: 78
Char: 62
Code: 0
URI: http://localhost:58337/Default.aspx

Very strange buit that is how we solved the problem.

The exact error is when telerik controls render the javascript onchange of some control, in some cases it uses setTimeout function. the actual javascript function (here AJAXNS.AR) is being passed as an argument to setTimeout function. and the third argument in function AjaxNS.AR is ID of RadAjaxManager. that is being passed in single quotes, which needs to be passed with backslash.
See the code below generated by Telerik controls ('RadAjaxManager1' has single quote without backslash)
<select name=
"usercontrol:citydropdown"
onchange=
"javascript:setTimeout('AjaxNS.AR(\'usercontrol:citydropdown\',\'\', 'RadAjaxManager1', event)', 0)"
id=
"usercontrol_citydropdown"
> </select>

Excerpt from a ASP.NET Breaking Changes in 4
Extensible HTML, URL, and HTTP Header Encoding
In ASP.NET 4, you can create custom encoding routines for the following common text-encoding tasks:
- HTML encoding.
- URL encoding.
- HTML attribute encoding.
- Encoding outbound HTTP headers.
You can create a custom encoder by deriving from the new System.Web.Util.HttpEncoder type and then configuring ASP.NET to use the custom type in the httpRuntime section of the Web.config
file, as shown in the following example:
<httpRuntime encoderType="Samples.MyCustomEncoder, Samples" />

'RadAjaxManager1'
is inserted in client side html after htmlencoder call. If it solved your problem, that indicates, the source of your problem is different. Also, just fyi, my problem is not with ' single quote or ' they behaves same way in html rendering. The third argument in this function should be \'RadAjaxManager1\'
or \
'RadAjaxManager1\'
;.
Both will work. Problem is telerik missed backslash. In .net2 it works,
because, setTimeout function is not being called, so there are no
single quotes for setTimeout function and there is no need of backslash
before quote for the third argument.
in
.Net2 it is like
<select name=
"usercontrol:citydropdown"
onchange=
"javascript:AjaxNS.AR('usercontrol:citydropdown','', 'RadAjaxManager1', event)"
id=
"usercontrol_citydropdown"
> </select>
In .Net4 it is like
<select name=
"usercontrol:citydropdown"
onchange=
"javascript:setTimeout('AjaxNS.AR(\'usercontrol:citydropdown\',\'\', 'RadAjaxManager1', event)', 0)"
id=
"usercontrol_citydropdown"
> </select>

Thanks,
-Rajiv

To confirm, you can just save the one line script in html page and render it. It works same way either you use ' or single quote. See his code for <select name="ctl00$PageC ..... >, save this one line as html page and browse, replace ' with single quote and then browse, you will see same error.
I have same problem as Pankaj. And by overriding htmlencode, ' can be replaced with single quote with no problem. But that does not resolve our problem. Your problem may be different if it is resolved by replacing ' after overriding htmlencode.
This problem is because of the bug in code generation by Telerik controls and it needs replacing of ' by \'. This single quote is introduced in the code by telerik controls after htmlencode call on the page.

Actually, I have met almost the same problem. I have tried to solve it
based on the above clarification. I found it failed. <
BR
>My main issue is
that , whenThe DropDownlist in the user control try to fire another
DropDownList control based on the RadAjaxManager control, the trigger event has
not been triggered based on the "OnSelectedChangeIndex" event of
fore-dropdownlist.<
BR
>This issue occurs after the application is upgraded from
the .NET framework 2.0 to .NET framework 4.0.<
BR
><
BR
>I hope i can get urgent
help for this issue.
Please ensure that you are using the correct dll for framework 4.0, Find attached a small application which works correctly on my side. Let me know what the difference in your case is.
Regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Hello Maria,
Thanks for looking into problem. You gave an example, which works fine in our case also. You have dropdown in default.aspx page. The problem is when you have dropdown in user control. and use the user control in default.aspx page. You will see setTimeout function which creates problem because of 'RadAjaxManager1' that should be \'RadAjaxManager1\'. sshot-4.png from George is also also missing back slash in 'ctl04_RadajaxManager1'. it will be helpful, if you look further.
Please find attached the modified version of the previously provided application. The project uses UserControl however I'm still not able to observe the described behaviour. See the attachment and let me know if I'm missing something
Greetings,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

I think, this error comes on some combination. I could not find that combination. But the point i missed is, we have upgraded the application to use .net 4.0 and the radajax version upgraded to version 2.0. So, may be this error is when we are using RadAjax.Net2 with .Net 4.0. In your example you are using Telerik.Web.UI. Is there any solution other than upgrading Radajax.Net2 to Telerik.web.ui.
Note that the classic RadControls are no longer supported and they are not designed to work with .Net 4.0. I would suggest you to upgrade your application to the latest release of RadControls for ASP .Net Ajax, use the dll file for .Net 4.0 and verify if the issue still appears on your side.
Regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Rajiv,
Would you mind posting the custom encoding class you wrote to get around this?
We've just upgraded to .NET 4.5.1 from 2.0 and get the same issue with the classic Telerik Ajax controls. We want to get .NET 4.5.1 working before moving our Telerik controls from Classic to ASP.NET AJAX and if there is some temporary step we can use like a custom encoder then that would be a help with our migration so we don't do everything at once.
Thanks in advance.
I would suggest you to open a separate support ticket and describe in details the exact issues you are currently facing after the upgrade. Thus we will be able to revise you specific case and advise you on possible fixes.
Regards,
Maria Ilieva
Telerik

RadAjax.Net2 is part of the RadControls for ASP.NET suite, which was discontinued in 2009 in favor of Telerik UI for ASP.NET AJAX.
This component is 10+ years old and neither supports .NET 3, nor 4.7.2.
My advice is plan migration to RadAjaxPanel from Telerik UI for ASP.NET AJAX (Telerik.Web.UI.dll assembly), which supports all .NET frameworks as well as all modern browsers:
Best Regards,
RumenProgress Telerik