Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Show radwindow in page load
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Show radwindow in page load

Feed from this thread
  • Posted on Jul 26, 2007 (permalink)

    hi.
    i wanna set my radwindow to show up just once in the load event of one of my website pages.
    i mean when the page posts back, the window does not show up again.
    how can i do that ?
    should i do that in code behind or the aspx file of my page ?
    thanks

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Jul 27, 2007 (permalink)

    Hi asarshad,

    You can do this by checking if the page is postback-ed and set the RadWindow's VisibleOnPageLoad property to true / false.
    e.g:

    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
            'check if the page is postback-ed or not and set the RadWindow accordingly  
            If Page.IsPostBack Then 
                RadWindow1.VisibleOnPageLoad = False 
                Else 
                RadWindow1.VisibleOnPageLoad = True 
            End If 
    End Sub 


    For convenience I've attached to this thread a small sample that shows this approach in action.




    All the best,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
    Attached files

  • Posted on Jul 27, 2007 (permalink)

    thanks you for your reply.
    if i use your code, when i change the page and return to the main page ( that keeps the radwindow code ), the window shows up again. because it's not postback.

    i want the code runs just once and after that it destroys and never shows up again in the site.
    thank you again for your help

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Jul 30, 2007 (permalink)

    Hello asarshad,

    In this scenario I would suggest to check in the session if the RadWindow has already been open or not, not in the Page_Load event.

    Please note that the desired functionality is not directly related to the RadWindow control. You will need to find a way to fire a control only once - for example to populate a label on your parent page only once. Once you achieve this, you can use the same logic with the RadWindow control. I would suggest checking the asp.net forums for possible solutions.



    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Posted on Apr 21, 2011 (permalink)

    Hi Georgi,

    I don´t know what´s happening with my code...

    Please, I need your help.

    I put the code to show the radwindow while my page is loading, but, radwindow is showed only after my page is fully loaded and radwindow don´t disapears anymore.

    Asp.net code:


    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" ShowOnTopWhenMaximized="false">
            <Windows>
                <telerik:RadWindow runat="server" ID="RadWindow1" BorderWidth="1px" VisibleTitlebar="false" VisibleStatusbar="false" Height="160px" Animation="Fade">
                    <ContentTemplate>                    
                        <table width="100%" cellpadding="7px">
                        <tr><td></td></tr>
                        <tr><td align="center" style="font-family:Arial;font-size:medium;font-weight:bold;">Sistema analisando ambiente...</td></tr>
                        <tr><td align="center">(carregando informações)</td></tr>                    
                        <tr><td align="center"><img src="images/pmpartner-loader.gif" /></td></tr>
                        </table>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
    </telerik:RadWindowManager>

    C# code:

    protected void Page_Load(object sender, EventArgs e)
    {
            if (Page.IsPostBack)
            {
                RadWindow1.VisibleOnPageLoad = false;            
            }
            else
            {
                RadWindow1.VisibleOnPageLoad = true;            
            }
    }

    Thanks, best

    Daniel

  • Posted on Apr 26, 2011 (permalink)

    Hello Daniel,

    I tried to reproduce the same but no avail. The code worked as expected at my end. The window disappears only when the PostBack happens. Make sure that you have tried with any postBack controls which cause postBack (refresh is not postBack).
    aspx:
      <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" ShowOnTopWhenMaximized="false">
            <Windows>
                <telerik:RadWindow runat="server" ID="RadWindow1" BorderWidth="1px" VisibleTitlebar="false" VisibleStatusbar="false" Height="160px" Animation="Fade">
                    <ContentTemplate>                   
                        <table width="100%" cellpadding="7px">
                        <tr><td></td></tr>
                        <tr><td align="center" style="font-family:Arial;font-size:medium;font-weight:bold;">Sistema analisando ambiente...</td></tr>
                        <tr><td align="center">(carregando informações)</td></tr>                   
                        <tr><td align="center"><img src="images/pmpartner-loader.gif" /></td></tr>
                        </table>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
    </telerik:RadWindowManager>
    <asp:Button ID="Button1" runat="server" Text="Hide the Window" />//It will hide the window

    Thanks,
    Shinu.

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Apr 26, 2011 (permalink)

    Hello Daniel,

    Note that you cannot show a RadWindow (this holds true for any other standard ASP.NET AJAX control) while the page is loading. All ASP.NET AJAX controls, including RadControls for ASP.NET AJAX, are shown on the page on a later stage - after the page has been loaded, in Sys.Application.Load.
    If you want to show some loading indicator, I would suggest to use a standard DIV element with CSS styling, which you could hide once all ASP.NET AJAX controls are loaded. For hiding the DIV, you could use for example pageLoad() - this function is automatically fired once the controls are loaded.


    Greetings,
    Georgi Tunev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  • Posted on Apr 28, 2011 (permalink)

    Hi Georgi / Shinu,

    Thanks for response.

    I understand, it´s not possible to use radwindow in pageload, but, radwindow have a beautifull appearance.

    Please, do you have an example of "window" to show in page while is charging a big grid and chart? (some users close the browser thinking that there was a problem)

    I appreciate your help.

    Abraço, best

    Daniel

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on May 3, 2011 (permalink)

    Hi Daniel,

    I prepared a small sample that shows a styled div while the grid is being loaded - I hope this helps. You will need to additionally style it so it matches your requirements.
    <%@ Page Language="C#" %>
     
    <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
     
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
     
            System.Data.DataTable tbl = new System.Data.DataTable();
            System.Data.DataColumn col = new System.Data.DataColumn("ID");
            col.DataType = typeof(int);
            tbl.Columns.Add(col);
            col = new System.Data.DataColumn("Name");
            col.DataType = typeof(string);
            tbl.Columns.Add(col);
            col = new System.Data.DataColumn("Group");
            col.DataType = typeof(string);
            tbl.Columns.Add(col);
     
            int size = 20000;
            int maxLen = size.ToString().Length;
            for (int i = 1; i <= size; i++)
            {
                tbl.Rows.Add(new object[] { i, "Name " + i.ToString("D" + maxLen), "Group " + i % 5 });
            }
            RadGrid1.DataSource = tbl;
        
    </script>
    <head id="Head1" runat="server">
        <title></title>
        <style type="text/css">
             
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div id="waitDiv" style="width: 100%; background-color: Red;">
            <p style="font-size:xx-large; font-weight:bold">
                Please wait while loading...</p>
        </div>
        <script type="text/javascript">
            function pageLoad()
            {
                var div = $get("waitDiv");
                div.style.display = "none";
            }
         
        </script>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadGrid ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" runat="server">
        </telerik:RadGrid>
        </form>
    </body>
    </html>




    All the best,
    Georgi Tunev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  • Posted on May 4, 2011 (permalink)

    Hi Georgi,

    I really appreciate your help.

    Please, one last tentative...

    I have a RadTabStrip (1) and another radtabstrip (2) calling external pages in radpageviw with ContentUrl="xxx.aspx".

    I really would like that calling a radwindow when radtabstrip (2) is called and this radwindow disappears when the contenturl page is fully loaded.

    I´m calling radwindow on pageload event from radtabstrip page (2), OK in this point.

    My problem is how can I do to disappear the radwindow after my page is fully loaded.

    Please, what is the event called when one radpageview is totally loaded or shown to the client? I guess that radwindow can be closed in this event.

    Sorry for insist in this solution, but, I have not found other solutions visually so good like radwindow.

    Thanks, best

    Daniel


    My asp.net code:

    <telerik:RadTabStrip runat="server" ID="RadTabStrip1_MENUPRINCIPAL_00" MultiPageID="RadMultiPage1_MENUPRINCIPAL_00"
                                Skin="Black" BackColor="Transparent">
                                <Tabs>
                                    <telerik:RadTab Text="DASHBOARD" PostBack="False" BackColor="Transparent">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="ESTRATÉGIAS" PostBack="False" BackColor="Transparent" Selected="True">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="PROJETOS" PostBack="False" BackColor="Transparent">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="PROCESSOS" PostBack="False" BackColor="Transparent">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="ADM" PostBack="False" BackColor="Transparent">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>

                            <telerik:RadMultiPage runat="server" ID="RadMultiPage1_MENUPRINCIPAL_00" BackColor="Transparent"
                                Width="100%" BorderColor="#594B42" BorderWidth="1px">
                                <telerik:RadPageView runat="server" ID="RadPageView1_DASHBOARD_0100" BackColor="Transparent"
                                    ContentUrl="0100_DASHBOARD.aspx" Height="100%" />
                                <telerik:RadPageView runat="server" ID="RadPageView2_ESTRATEGIA_0200" BackColor="Transparent"
                                    ContentUrl="0200_ESTRATEGIA.aspx" Height="100%" Selected="true" />
                                <telerik:RadPageView runat="server" ID="RadPageView3_PROJETOS_0300" BackColor="Transparent"
                                    ContentUrl="0300_PROJETOS.aspx" Height="100%" />
                                <telerik:RadPageView runat="server" ID="RadPageView4_PROCESSOS_0400" BackColor="Transparent"
                                    ContentUrl="0400_PROCESSOS.aspx" Height="100%" />
                                <telerik:RadPageView runat="server" ID="RadPageView5_ADM_0500" BackColor="Transparent"
                                    ContentUrl="0500_ADM.aspx" Height="100%" />
                            </telerik:RadMultiPage>

    0100_DASHBOARD.aspx

    <telerik:RadTabStrip ID="RadTabStrip_DASHBOARD_0100" runat="server" Skin="Sunset"
                MultiPageID="RadMultiPage_DASHBOARD_0100" CssClass="tabStrip_Rad" 
                SelectedIndex="5">
                <Tabs>
                    <telerik:RadTab Text="ESTRATEGIAS" PostBack="False" 
                        PageViewID="RadPageView1_DASHBOARD_0101" />
                    <telerik:RadTab Text="PROJETOS" PostBack="False" PageViewID="RadPageView2_DASHBOARD_0102" />
                    <telerik:RadTab Text="PROCESSOS" PostBack="False" PageViewID="RadPageView3_DASHBOARD_0103" />
                    <telerik:RadTab Text="FINANÇAS" PostBack="False" PageViewID="RadPageView4_DASHBOARD_0104" />
                    <telerik:RadTab Text="CRONOGRAMA" PostBack="False" PageViewID="RadPageView5_DASHBOARD_0105" />                
                    <telerik:RadTab Text="HOJE" PostBack="False" 
                        PageViewID="RadPageView7_DASHBOARD_0107" Selected="True" />
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage_DASHBOARD_0100" runat="server" Width="100%"
                BackColor="Transparent" SelectedIndex="5">
                <telerik:RadPageView ID="RadPageView1_DASHBOARD_0101" runat="server" Selected="true"
                    BackColor="Transparent" ContentUrl="0101_DASHBOARD_ESTRATEGIAS.aspx" Height="100%">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2_DASHBOARD_0102" runat="server" BackColor="Transparent"
                    ContentUrl="0102_DASHBOARD_PROJETOS.aspx" Height="100%">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3_DASHBOARD_0103" runat="server" BackColor="Transparent"
                    ContentUrl="" Height="100%">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView4_DASHBOARD_0104" runat="server" BackColor="Transparent"
                    ContentUrl="0106_DASHBOARD_EMPRESA.aspx" Height="100%">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView5_DASHBOARD_0105" runat="server" BackColor="Transparent"
                    ContentUrl="0105_DASHBOARD_CRONOGRAMA.aspx" Height="100%">
                </telerik:RadPageView>            
                <telerik:RadPageView ID="RadPageView7_DASHBOARD_0107" runat="server" BackColor="Transparent"
                    ContentUrl="" Height="100%">
                </telerik:RadPageView>
            </telerik:RadMultiPage>

  • Svetlina Anati Svetlina Anati admin's avatar

    Posted on May 6, 2011 (permalink)

    Hi Daniel,

    There is no such event but it is in our TODO list and will be implemented.

    I can provide you with some javascript which handles the moment the page is completely loaded but I am afraid that this will not work as you require. Please, note, that the content of all the page views is loaded when the page is first loaded. This means that when you click on the next tab, the pageview has already been loaded and does not reload on the tab selecting.

    This being said, I think that the best solution for the case is to use the tab selecting event and close the RadWindow e.g with a small timeout.

    If I have not understand you correctly, please provide more details and I will do my bets to help.

    Regards,
    Svetlina
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  • Posted on May 17, 2011 (permalink)

    Hi Svetlina,

    I understood your concern.

    I think that a javascript to close radwindow after some time can be a problem, because I can have a radgrid with 10 items or with 10000 items.

    If we called the javascript to close radwindow when radchart or radgrid is totally showed to the client side. What do you think about this?

    In true, I´d like to call a radwindow when I charging a radgrid or building a radchart and close radwindow when I finish to charge the radgrid or build radchart. This way is possible to call radwindow for any control when is necessary some processing.

    Hope I have managed to explain properly.

    I really like radwindow!!!

    Thanks for attention.

    Best,

    Daniel

  • Marin Bratanov Marin Bratanov admin's avatar

    Posted on May 20, 2011 (permalink)

    Hi Daniel,

    Your idea can work if the control has an event that indicates that the loading is complete, but it is not available in all controls and cases. You could use the RadGrid's OnGridCreated event, for example.

    In case you are using AJAX I would also suggest that you take a look at the RadAjaxManager (OnResponseEnd and OnRequestStart client events) and the ability to use a LoadingPanel while the asynchronous request is being processed:

    http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/clientevents/defaultcs.aspx

    http://demos.telerik.com/aspnet-ajax/ajax/examples/loadingpanel/loadingimages/defaultcs.aspx

    http://demos.telerik.com/aspnet-ajax/ajax/examples/common/loadingusercontrols/defaultcs.aspx



    All the best,
    Marin
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

  • Posted on May 22, 2011 (permalink)

    Hi Marin,

    Please, is it possible to produce a sample project with this functionality?

    I know how the logic must be, but, I´m very new with Telerik controls.

    Thanks, best

    Daniel

  • Marin Bratanov Marin Bratanov admin's avatar

    Posted on May 23, 2011 (permalink)

    Hi Daniel,

    Please note that our support system is focused on providing workarounds for bugs and controls' incompliances and we do not develop custom solutions. We have uploaded a lot of online demos which cover the functionality of the controls and they should be enough to let the developer extend them further in order to implement the desired scenario. I recommend to examine this online demo which is very similar to your requirement. When you install RadControls, our online examples projects are automatically installed on your computer and you can not only examine their full source code, but also extend them further in order to meet your requirements.

    Nevertheless, for your convenience I created and attached a simple page that shows the RadWindow when the ajax request starts and closes it when the request is complete.



    Best wishes,
    Marin
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

  • Posted on May 28, 2011 (permalink)

    Hi Marin,

    Thank you for your help.

    Your suggestion help me a lot.

    Best,

    Daniel

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Show radwindow in page load