Changing windows content

6 posts, 0 answers
  1. Robert
    Robert avatar
    55 posts
    Member since:
    Aug 2008

    Posted 08 Jan 2009 Link to this post

    Hi,

    I want to implement some wizard-like functionality. When the user clicks a "next" button inside a RadWindow the content of the window shall be replaced by another page. I have tried this with redirect but it didn't work as expected.
    What is a suggested way to implement this behaviour.

    Best regards,
    Robert
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Jan 2009 Link to this post

    Hi Robert,

    You can try this either from the server side using Response.Redirect(URL) or from client side by changing the URL of the window.

    Option 1 - Server side:
    CS:
    protected void Button3_Click(object sender, EventArgs e) 
        Response.Redirect("http://www.google.com"); 

    Option 2 - Client side:
    JavaScript:
    <script type="text/javascript"
    function GetRadWindow() 
        var oWindow = null
        if (window.radWindow) oWindow = window.radWindow; 
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 
        return oWindow; 
    }  
    function ChangePage() 
        GetRadWindow().SetUrl('Page1.aspx'); 
    </script> 

    ASPX:
    <input id="Button2" type="button" value="Change URL" onclick="return ChangePage()"/> 

    Thanks,
    Princy.
  3. Matt
    Matt avatar
    16 posts
    Member since:
    Aug 2007

    Posted 29 Aug 2009 Link to this post

    We're using this approach and all is working fine, except how can we make it show an AJAX loading graphic while the new page loads (in the existing window)?  We have some DB queries in the 2nd page's Load event that take some time and right now it just sits there on the 1st page and the user can't really tell that anything is happening.  Is there something like "ShowContentOnLoad" that works for Response.Redirect??
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 31 Aug 2009 Link to this post

    Hello nowickim,

    You could try using RadAjaxLoadingPanel for that purpose.


    All the best,
    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.
  5. Matt
    Matt avatar
    16 posts
    Member since:
    Aug 2007

    Posted 31 Aug 2009 Link to this post

    I'm not sure I follow.  Can you elaborate?
  6. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 01 Sep 2009 Link to this post

    Hi nowickim,

    What I suggest is:
    1. Put a RadAjaxLoadingPanel on the parent page.
    2. When the button in your first page is clicked (the one that will redirect to the second page), show the RadAjaxLoadingPanel. You could use its API to position it over the RadWindow so it will look like it is in the content page, but will actually stay on the parent. This will allow you to show loading animation while the page in the RadWindow's IFRAME is redirected.
      You could do this by using RadWindow's client-side API and execute the JavaScript function on the parent page that will show the panel.
    3. Once the second page is loaded (you could do this in pageLoad() on the client) , call another JavaScript function on the parent page that will hide the RadAjaxLoadingPanel.
    The information about explicitly showing RadAjaxLoadinPanel is available in the help article that I linked in my previous reply. This help article will show you how to call a function on the parent page from within RadWindow.

    Best wishes,
    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.
Back to Top