This is a migrated thread and some comments may be shown as answers.

radwindowmanager always undefined with in Masterpage from contentplaceholder

1 Answer 153 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
archimede
Top achievements
Rank 1
archimede asked on 07 Apr 2014, 01:50 PM
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
and
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

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Apr 2014, 10:03 AM

Hi,

There are two ways to solve this:

I hope this helps.


Regards,

Marin Bratanov
Telerik
 

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.

 
Tags
General Discussions
Asked by
archimede
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or