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 / Show Content During Load

Choose site:
select


                    ShowContentDuringLoad="false"                                                                  ShowContentDuringLoad="true"

  • Using ShowContentDuringLoad in RadWindow


    The RadWindow's ShowContentDuringLoad property controls whether RadWindow will show the page while it is loaded or will wait until the page is completely loaded (e.g. window.onload is fired in the content page). If ShowContentDuringLoad is set to false, RadWindow will display a loading image that can be controlled with CSS.

    Note:
    If you intend to show a PDF file in RadWindow instead of a standard page, make sure that ShowContentDuringLoad is set to true. Otherwise if the loaded content is not a page, window.onload will not be fired and RadWindow will not show the content.

Source Code

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

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <!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 runat="server" ID="Headtag1"></qsf:HeadTag>
        <!-- custom head section -->
        <!-- end of custom head section -->
        <style type="text/css">
            /*
            MAKE INACTIVE WINDOW LOOK LIKE ACTIVE FOR DEMONSTRATION PURPOSES AND CLARITY OF EXAMPLE
        */
        div.RadWindow.rwInactiveWindow td.rwCorner, div.RadWindow.rwInactiveWindow td.rwTitlebar, div.RadWindow.rwInactiveWindow td.rwFooterCenter
        {
            opacity:1 !important;
         filter:none !important;
        }
        </style>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="VB" />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        Choose site:
        <telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged">
            <Items>
                <telerik:RadComboBoxItem Text="Telerik" Value="http://www.telerik.com" />
                <telerik:RadComboBoxItem Text="Yahoo" Value="http://www.yahoo.com" />
                <telerik:RadComboBoxItem Text="CodePlex" Value="http://www.codeplex.com/" />
                <telerik:RadComboBoxItem Text="MSDN" Value="http://msdn.microsoft.com/en-us/default.aspx" />
            </Items>
        </telerik:RadComboBox>
        <div style="height: 390px; width: 840px">
            <br />
            <br />
            &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<strong>
                ShowContentDuringLoad="false"</strong>
            <telerik:RadWindow ID="RadWindow2" runat="server" Height="300px" Width="300px" Left="500"
                EnableShadow="true" Top="300" NavigateUrl="http://www.telerik.com" VisibleOnPageLoad="true"
                ShowContentDuringLoad="false" />
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<strong>ShowContentDuringLoad="true"</strong>
            <telerik:RadWindow ID="RadWindow1" runat="server" Height="300px" Width="300px" Left="900"
                Top="300" NavigateUrl="http://www.telerik.com" VisibleOnPageLoad="true" ShowContentDuringLoad="true"
                EnableShadow="true" />
            <script type="text/javascript">
                function OnClientSelectedIndexChanged(sender, eventArgs)
                {
                    var item = eventArgs.get_item();
                    var wnd = $find("<%= RadWindow1.ClientID %>");
                    var wnd2 = $find("<%= RadWindow2.ClientID %>");
                    wnd.setUrl(item.get_value());
                    wnd2.setUrl(item.get_value());
                }
            </script>
        </div>
        <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