radwindowmanager always undefined with in Masterpage from contentplaceholder

2 posts, 0 answers
  1. archimede
    archimede avatar
    108 posts
    Member since:
    Jul 2006

    Posted 07 Apr 2014 Link to this post

    Good day,

    We need help with the following problem:
    We have a masterpage with 3 different contentplaceholders. One of these (the 'body' contentplaceholder) loads a simple page, which is basically straight from your radwindowmanager samples from here: http://demos.telerik.com/aspnet-ajax/window/examples/windowmanager/defaultcs.aspx

    In this 'body' we have the a button:
     runat="server" OnCommand="openalert_Click"

    In the cs

        protected void openalert_Click(Object sender, CommandEventArgs e)
            ViewAlert(rwp, "test", rwp.Page);

    where the ViewAlert function is basically this:

    public static RadWindowManager ViewAlert(RadWindowManager radWinmanager, String Warning = null, Page pTarget = null) {
      string radstrcommand = "radalert('" + Warning + "', 200, 200, 'Test', null);";
      System.Web.UI.ScriptManager.RegisterStartupScript(pTarget, pTarget.GetType(), "call_radalert", radstrcommand, true);

    Our problem is that any and all attempts to successfully open a radalert after pressing of the button are met with failure.
    Using firebug we know that
    radWindow is undefined
    GetRadWindowManager returns undefined
    whenever the page reloads after the RegisterStartupScript

    We conclude this to be a timing / load order issue of some sort, related to the load time of the radWindow in respect to the trigger of the RegisterStartupScript, but how are we supposed to solve it?
    Is there perhaps a better approach to manage the RegisterStartupScript (we don't use ajax for this particular case since we need a postback)

    Thanks in advance
  2. Marin Bratanov
    Marin Bratanov avatar
    5428 posts

    Posted 09 Apr 2014 Link to this post


    There are two ways to solve this:

    I hope this helps.


    Marin Bratanov

    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