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

[Solved] Radwindow close and reopen itself?

2 Answers 207 Views
Window
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 13 Jun 2008, 02:14 PM
I have a window that pops open from a parent page.  On that window you can enter/edit data.  If you are entering new data you can hit a "Save" button which saves the data and then closes the window.  This works fine.

I would like to add a button that allows a user to "Save / Add More" such that they can save the data and then have the window refresh itself so that the controls are all cleared and they have a blank form to work with.  In this scenario I do not want the window closing on save - unless I can get it to automatically open itself again.

I realize I can write code to clear all of the controls but if there is an easier way to "reload" the window I would like to explore that option.

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 16 Jun 2008, 11:11 AM
Hi sl6rp,

I suggest to use the following function in order to reload the window:

function ReloadWindow()  
{  
    window.location.href = window.location.href;  

You should execute it from the server, after you have saved the information. One of the approaches to do this is the following:

 protected void Button1_Click(object sender, EventArgs e)  
    {  
        //Code to save to DB here  
         ClientScript.RegisterStartupScript(GetType(), "reloadWindow""ReloadWindow();"true);  
    } 

For your convenience I am attaching a sample demo project.

Kind regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Curt
Top achievements
Rank 1
answered on 17 Jun 2008, 01:59 PM
Thanks for the example.  It did exactly what I needed.

-Brent
Tags
Window
Asked by
Curt
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Curt
Top achievements
Rank 1
Share this question
or