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

Invalid client javascript code

5 Answers 103 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 23 Sep 2010, 06:11 PM
I have an issue with several pages in a large project. Essentially what the problem breaks down into is that the ajax is not getting called correctly due to javascript errors. This occurs in several locations but I will focus just on one at the moment. The client side html is as follows:

<select name="ctl00$cphPageContent$groups" id="ctl00_cphPageContent_groups" style="width: 290px; height: 450px;" onchange="javascript:setTimeout('AjaxNS.AR(\'ctl00$cphPageContent$groups\',\'\', 'ctl00_RadAjaxManager_WebSiteMaster', event)', 0)" size="4">
 <option selected value=tg1>Test Group</option>
 <option value=tg2>Test Group 2</option>
</select>

In the onchange method, 'ctl00_RadAjaxManager_WebSiteMaster' is within the setTimeout's javascript call. The problem with this is that it should be [\'ctl00_RadAjaxManager_WebSiteMaster\'] (minus the brackets). Notice the slashes before the single quote mark. Does anyone have any idea why this would be showing up like this? The asp code for the listbox is below and the options for the event are in the code behind. Note that having the event in the code behind or in the aspx page does not make a difference.

<asp:ListBox ID="groups" Width="290px" Height="450px" runat="server"></asp:ListBox>

groups.AutoPostBack = true;
groups.SelectedIndexChanged += new EventHandler(groups_SelectedIndexChanged);

5 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 23 Sep 2010, 08:33 PM
Went back and reviewed my issue after taking a break. I realized that I left out a portion of the code that is needed to assist me with this situation. I am also utilizing the RadAjaxManager to add AjaxSettings to the listbox.

RadAjaxManager ajm = (RadAjaxManager)Master.FindControl("RadAjaxManager_WebSiteMaster");
ajm.AjaxSettings.AddAjaxSetting(groups, div_groupServer);
ajm.AjaxSettings.AddAjaxSetting(groups, div_groupContents);
ajm.AjaxSettings.AddAjaxSetting(groups, div_edit);

The divs are areas in which need to get updated after a new option in the listbox is selected.
0
Iana Tsolova
Telerik team
answered on 28 Sep 2010, 03:39 PM
Hi Dan,

Are you using RadControls for ASP.NET AJAX or RadControls for ASP.NET?
However to resolve the issue we will need to replicate the problem. So I would ask you to send us a runnable version of your code.

Kind regards,
Iana
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
0
Dan
Top achievements
Rank 1
answered on 08 Oct 2010, 08:55 PM
Eh... I just removed the telerik controls. I can live without Ajax on that page. Thank though.
0
Ena
Top achievements
Rank 1
answered on 13 Jan 2014, 02:57 PM
We had same problem while upgrading 2.0 applications to 4.0.
Ajax for asp.net 2.0 is out of support now.
It can be fixed by upgrading ajax control. Just to make  single quote working, upgrade thousands of page... no way...;
We are also removing telerik controls from our projects one by one and then upgarding asp.net 2.0 to 4.0.

0
Maria Ilieva
Telerik team
answered on 15 Jan 2014, 11:19 AM
Hello Ena,

Could I kindly ask you to provide detailed description of the exact issues you are facing after the upgrade? Thus we could provide straight to the point solution without the need of big, time consuming changes.

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Ajax
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Iana Tsolova
Telerik team
Ena
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or