This is a migrated thread and some comments may be shown as answers.

Changing windows content

5 Answers 98 Views
Window
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 08 Jan 2009, 07:23 AM
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

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Jan 2009, 09:13 AM
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.
0
Matt
Top achievements
Rank 1
answered on 30 Aug 2009, 03:07 AM
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??
0
Georgi Tunev
Telerik team
answered on 31 Aug 2009, 06:00 AM
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.
0
Matt
Top achievements
Rank 1
answered on 31 Aug 2009, 03:27 PM
I'm not sure I follow.  Can you elaborate?
0
Georgi Tunev
Telerik team
answered on 01 Sep 2009, 10:57 AM
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.
Tags
Window
Asked by
Robert
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Matt
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or