Odd disruption of JavaScript calls from RadGrid

2 posts, 0 answers
  1. Boris
    Boris avatar
    289 posts
    Member since:
    Oct 2012

    Posted 29 Sep 2014 Link to this post

    Frankly I'm asking this one only because I'm curious.  

    I have a fairly conventional RadGrid set up with edit links on each row.  Each link calls a JavaScript function which in turn causes an editing screen popup.  

    The link elements look like this:  
    <a id="ctl00_MainContent_RadGrid1_ctl00_ctl04_EditLink" href="#" onclick="return EditForm('14001','0');">Edit</a>

    I also have a span at the top of the page that displays "Welcome" logged in person.  Somehow someone messed up the users table and the name field included characters within double quotes.  As such, for example, the field would be rendered like this:
      <span id="lblFullName" style="color:Blue;">Welcome Joe "***" Smith</span>

    When this happened, the JavaScript function started crashing. The function got the correct parameters but this line started crashing.
     var oWnd = window.radopen("EditForm.aspx?Id=" + Id, "Edit Item " + Id); 

    When I put a catch in there, the error was Cannot read property 'open' of undefined.

    Naturally the practical solution to this problem was to purge the database of bad data but I'd still like to know what happened.

  2. Kostadin
    Kostadin avatar
    1733 posts

    Posted 02 Oct 2014 Link to this post

    Hi Boris,

    I am afraid I am not sure when the JavaScript throws an error. How the double quotes in the span element are connected with the script which opens the EditForm? I would appreciate if you could provide a small runnable sample in order to investigate the cause for this issue further.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top