Invalid client javascript code

6 posts, 0 answers
  1. Dan
    Dan avatar
    3 posts
    Member since:
    Sep 2010

    Posted 23 Sep 2010 Link to this post

    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>

    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);
  2. Dan
    Dan avatar
    3 posts
    Member since:
    Sep 2010

    Posted 23 Sep 2010 Link to this post

    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.
  3. Iana Tsolova
    Iana Tsolova avatar
    3388 posts

    Posted 28 Sep 2010 Link to this post

    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,
    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
  4. Dan
    Dan avatar
    3 posts
    Member since:
    Sep 2010

    Posted 08 Oct 2010 Link to this post

    Eh... I just removed the telerik controls. I can live without Ajax on that page. Thank though.
  5. Ena
    Ena avatar
    4 posts
    Member since:
    May 2011

    Posted 13 Jan 2014 Link to this post

    We had same problem while upgrading 2.0 applications to 4.0.
    Ajax for 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 2.0 to 4.0.

  6. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 15 Jan 2014 Link to this post

    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.

    Maria Ilieva
    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.
Back to Top