First Window Refresh a Second Window

4 posts, 0 answers
  1. Bruno Roberto
    Bruno Roberto avatar
    5 posts
    Member since:
    Nov 2009

    Posted 11 Nov 2009 Link to this post

    Hi,

    I’m a beginner in “asp.net” and “telerik” and I need your help. How can I change page of “secondwindow” (secondpage.aspx) by pressing a button in the  firstwindow (firstpage.aspx)?

    I would like to refresh "secondpage" to "thirdpage" by pressing a button in the "firstpage".

     

    This is my code on the page default.

     

    <form id="fDefault" runat="server">

     

    <telerik:RadScriptManager ID="RadScriptManager" Runat="server">

    </telerik:RadScriptManager>

    <telerik:RadWindow ID="WinFirst" runat="server" NavigateUrl="firstpage.aspx">

    </telerik:RadWindow>

                   

    <telerik:RadWindow ID="WinSecond" runat="server" NavigateUrl="secondpage.aspx">

    </telerik:RadWindow>

    </form>

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Nov 2009 Link to this post

    Hi Bruno,

    Here is the code that I tried in order to achieve same kind of scenario.

    MainPage.aspx
     
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
            <Windows> 
                <telerik:RadWindow NavigateUrl="win1.aspx" VisibleOnPageLoad="true" ID="Win1"
                </telerik:RadWindow> 
                <telerik:RadWindow NavigateUrl="win2.aspx" VisibleOnPageLoad="true" ID="Win2"
                </telerik:RadWindow> 
            </Windows> 
        </telerik:RadWindowManager> 

    Win1.aspx (First page)
     
    <input id="Button1" type="button" value="button" onclick="change();" />

    <script type="text/javascript"
        function change() { 
            var manager = GetRadWindow().get_windowManager(); 
            var window2 = manager.getWindowByName("Win2"); 
            window2.setUrl('Win3.aspx'); 
        } 
        function GetRadWindow() { 
            var oWindow = null
            if (window.radWindow) 
                oWindow = window.radWindow; 
            else if (window.frameElement.radWindow) 
                oWindow = window.frameElement.radWindow; 
            return oWindow; 
        }   
    </script> 

    -Shinu.
  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 11 Nov 2009 Link to this post

    Hi Bruno,

    In addition to the code that Shinu provided (thank you, Shinu), I would suggest to examine this demo as well:
    http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx
    It uses a logic similar to the one that you wish to implement.

    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. Bruno Roberto
    Bruno Roberto avatar
    5 posts
    Member since:
    Nov 2009

    Posted 11 Nov 2009 Link to this post

    Thanks for the help Shinu and Georgi.
Back to Top