Telerik
Home / Community / Forums / Grid / window message don't popup when call OnGridCreated = "alert('test\ntest');"

Not answered window message don't popup when call OnGridCreated = "alert('test\ntest');"

Feed from this thread
  • Posted on Apr 11, 2009 (permalink)

    Hi,
        i have try to popup message when using radgrid with Ajax enabled. after try with command:
    RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "alert('test');"
    is works but when i try  with :
    RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "alert('test\ntest');"   ' (put new line)
    window message don't popup and got an error message: Unterminated string constant

    This error happened with both IE7 and Firefox

    BR,
    Kenghot

    Reply

  • Telerik Admin admin's avatar

    Posted on Apr 13, 2009 (permalink)

    Hello Kenghot,

    I believe the produced HTML code contains illegal JavaScript. I suppose the output contains something like this:
    <script> 
     
    ... 
    alert('test
    test); 
    .... 
     
    </script> 

    Unlike HTML, JavaScript strings cannot spread more than one line without being closed.

    I will suggest you try setting the alert message like this:
    RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "alert('test\\ntest');"  

    Best regards,
    Georgi Krustev
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.

    Reply

Related resourses for "window message don't popup when call OnGridCreated = "alert('test\ntest');""

ASP.NET Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]

Powered by Sitefinity ASP.NET CMS

Contact Us | Site Feedback | Terms of Use | Privacy Policy
Copyright © 2002-2010 Telerik. All rights reserved.