Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Window / RadWindowManager Client-side API

RadWindowManager methods


  •  RadWindowManager

    In RadControls for ASP.NET AJAX, the RadWindowManager is not mandatory to be present on the page in order to show a RadWindow. Using the RadWindowManager however, is still a convenient way to declare common properties for all RadWindow that will be created with it or are already declared in its Windows collection.

    On the client-side, the RadWindowManager takes care of:

    • creating and opening new windows
    • taking care of the radalert, radconfirm and radprompt dialogs - you must have a RadWindowManager control on your page in order to show these dialogs.
    • providing a reference to a RadWindow
    • group functions to allow RadWindows' manipulating at once (for example - minimizing, restoring or maximizing all RadWindows on the page)

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Window.WindowManager.DefaultCS" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <style type="text/css">
            .controlButtons, .controlButtons li
            {
                padding: 0;
                margin: 0;
                list-style: none;
            }
            
            .controlButtons li
            {
                padding: 4px 8px;
            }
            
            .controlButtons button
            {
                width: 154px;
            }
        </style>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <script type="text/javascript">
         //<![CDATA[
            function confirmCallBackFn(arg)
            {
                radalert("<strong>radconfirm</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Result");
            }

            function promptCallBackFn(arg)
            {
                radalert("After 7.5 million years, <strong>Deep Thought</strong> answers:<h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Deep Thought");
            }

            function OpenAlert()
            {
                radalert('<h4>Welcome to <strong>RadWindow</strong>!</h4>', 330, 100, 'RadAlert custom title');
                return false;
            }
            function OpenConfirm()
            {
                radconfirm('<h3 style=\'color: #333399;\'>Are you sure?</h3>', confirmCallBackFn, 330, 100, null, 'RadConfirm custom title');
                return false;
            }
            function OpenPrompt()
            {
                radprompt('<span style=\'color: #333399;\'>What is the answer of Life, Universe and Everything?</span>', promptCallBackFn, 330, 160, null, 'The Question', '42');
                return false;
            }


            function OpenWindow()
            {
                var wnd = window.radopen("http://www.google.com", null);
                wnd.setSize(400, 400);
                return false;
            }

            function controlWindowButtons()
            {
                var oManager = GetRadWindowManager();
                var selitem = null;
                var e = document.forms[0].elements["RadioButtonList1"];
                for (var i = 0; i < e.length; i++)
                {
                    if (e[i].checked)
                    {
                        selitem = e[i].value;
                    }
                }
                eval("oManager." + selitem);
            }
                    
              //]]>
        </script>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
        <div class="smallModule" style="float: left; margin: 10px 10px 0 0;">
            <div class="rc1">
                <div class="rc2">
                    <div class="rc3" id="offsetElement" style="width: 500px; height: 400px">
                        <telerik:RadWindowManager runat="server" RestrictionZoneID="offsetElement" ID="RadWindowManager1"
                            EnableShadow="true" ShowOnTopWhenMaximized="false">
                            <Windows>
                                <telerik:RadWindow ID="test1" NavigateUrl="../../TestPage/Default.html" VisibleOnPageLoad="true"
                                    Top="20" Left="100" runat="server">
                                </telerik:RadWindow>
                                <telerik:RadWindow NavigateUrl="../../TestPage/Default.html" VisibleOnPageLoad="true"
                                    ID="test2" Top="60" Left="160" runat="server">
                                </telerik:RadWindow>
                            </Windows>
                        </telerik:RadWindowManager>
                    </div>
                </div>
            </div>
        </div>
        <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Height="400" Title="RadWindowManager methods"
            Orientation="Vertical" Expanded="true">
            <asp:RadioButtonList ID="RadioButtonList1" AutoPostBack="false" runat="server">
                <asp:ListItem onclick="controlWindowButtons()" Value="cascade()" Text="Cascade"></asp:ListItem>
    <asp:ListItem onclick="controlWindowButtons()" Selected="true" Value="restoreAll()"
    Text="Restore All"></asp:ListItem>

                <asp:ListItem onclick="controlWindowButtons()" Value="minimizeAll()" Text="Minimize All"></asp:ListItem>
                <asp:ListItem onclick="controlWindowButtons()" Value="maximizeAll()" Text="Maximize All"></asp:ListItem>
                <asp:ListItem onclick="controlWindowButtons()" Value="closeAll()" Text="Close All"></asp:ListItem>
                <asp:ListItem onclick="controlWindowButtons()" Value="showAll()" Text="Show All"></asp:ListItem>
                <asp:ListItem onclick="controlWindowButtons()" Value="minimizeActiveWindow()" Text="Minimize Active Window"></asp:ListItem>
                <asp:ListItem onclick="controlWindowButtons()" Value="restoreActiveWindow()" Text="Restore Active Window"></asp:ListItem>
                <asp:ListItem onclick="controlWindowButtons()" Value="closeActiveWindow()" Text="Close Active Window"></asp:ListItem>
            </asp:RadioButtonList>
            <div>
                <ul class="controlButtons">
                    <li>
                        <button onclick="return OpenWindow()" id="button2">
                            Open with radopen</button></li>
                    <li>
                        <button onclick="return OpenAlert()">
                            Open radalert</button></li>
                    <li>
                        <button onclick="return OpenPrompt()">
                            Open radprompt</button></li>
                    <li>
                        <button onclick="return OpenConfirm()">
                            Open radconfirm</button></li>
                </ul>
            </div>
        </qsf:ConfiguratorPanel>
        <br style="clear: both;" />
        <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451