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

redirecting to a different page after window is closed

3 Answers 334 Views
Window
This is a migrated thread and some comments may be shown as answers.
Prateek Bahl
Top achievements
Rank 1
Prateek Bahl asked on 31 Mar 2010, 06:38 PM
Hi, I am using the RadWindow to let the users add information.  What I want to be able to do is, when the user adds a record, the window should close and then redirect the user to a different page.  Also, the user should be redirected only when the user has added record successfully.  How can I go about doing this?

[Note: the information is being stored server side.]

Prateek

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Apr 2010, 07:48 AM

Hi Prateek,

One suggestion would be using OnClientClose event of RadWindow to redirect to new page. You can place one HiddenField control on parent page and use that as a flag for checking whether succesful updation is performed.

JavaScript:

 
<script type="text/javascript">  
    function OnClientClose(sender, args) {  
        // check for HddenField value  
        window.location.href = "http://www.google.com";  // Redirect to new page  
    }  
</script> 

Set the HiddenField value from radwindow page when performing successfull updation. You can use the 'BrowserWindow' property to get access to parent window from radwindow page. The following documentation shows more about this.

Calling Functions in Windows

-Shinu.

0
Georgi Tunev
Telerik team
answered on 01 Apr 2010, 08:53 AM
Hi Prateek,

In such scenario, I would suggest the following logic:
  1. Execute your code in the codebehind
  2. Output a JavaScript function that would call top.location.href = "http://myUrl.com"
More information on the subject is available in this blog post:
http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx

All the best,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Prateek Bahl
Top achievements
Rank 1
answered on 01 Apr 2010, 09:58 PM
yup, I tried your method on a test page and it worked :).  Thanks for the help.
Tags
Window
Asked by
Prateek Bahl
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Georgi Tunev
Telerik team
Prateek Bahl
Top achievements
Rank 1
Share this question
or