Radalert popup issue

5 posts, 0 answers
  1. Joe
    Joe avatar
    28 posts
    Member since:
    May 2007

    Posted 20 Dec 2009 Link to this post

    Just having an issue using the radalert popup functionality...

    I'm using the approach from one of the help items like this:

    Label1.Text = "<script language='javascript'> window.onload = function(){radalert('<b>Please enter quantity!</b>','', 150, 100);}</script>";

    Having RadWindowManager control on the page so that should not be a problem.

    However, it gives out an error on this line:
    return d.radalert(e,c,a,b);
    Microsoft JScript runtime error: 'undefined' is null or not an object

    And then:
    Microsoft JScript runtime error: Object doesn't support this property or method

    Which doesn't seem to make sense, I thought that that was the parameters it was expecting!

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Dec 2009 Link to this post

    Hello Joe,

    Checkout the following KB Article which shows how to show RadAlert from code using RegisterStartupScript() server method of the ScriptManager.
    Calling radalert from codebehind (all versions of RadWindow)

    Hope this will help,
    Shinu.
  3. Joe
    Joe avatar
    28 posts
    Member since:
    May 2007

    Posted 21 Dec 2009 Link to this post

    Shinu, thanks a lot!!
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 21 Dec 2009 Link to this post

    Hi Joe,

    This is happening because in ASP.NET AJAX, all AJAX controls (including ours) are created on the page after window.onload() (when the script is called). Basically what is happening is that when you try to access the RadWindowManager, it is still not fully rendered on the page, which leads to this error.

    More information on the subject is available in the KB that Shinu posted and in this blog post:
    http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx


    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Joe
    Joe avatar
    28 posts
    Member since:
    May 2007

    Posted 21 Dec 2009 Link to this post

    Thanks Georgi!
Back to Top