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

How to close rad window on click of close button in user control

3 Answers 415 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ash
Top achievements
Rank 1
Ash asked on 11 Sep 2008, 09:45 AM
Hi Telerik

many thanks for taking my queries and for your technical support . I have a query regarding the user control i am opening inside rad window.
All i am doing is calling aspx page inside rad window that holds the user control.and i want to close the rad window on click of close button in user control.
Can we achieve this functionality. Any example would be helpful.
I am using ASP.net 2.0 and telerik version as RadControls for ASPNET AJAX Q1 2008 with IE7. Also the programming language i intend to use is c#

many thanks
Best Regards
Ash

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Sep 2008, 01:47 PM
Hello Ash,

Like the standard popup dialog (window.open()) RadWindow is closed from a client-side command only. What I can suggest in your case is to output a JavaScriptCode from the server once your database is updated.
Outputting JavaScript from server-side code is a general task and there are various ways to do it that depend on your exact setup. For example you can check the following KB article - it is for calling radalert() but the logic is the same:
http://www.telerik.com/support/kb/article/b454K-gtd-b454T-cec-b454c-cec.aspx

You will only have to make sure that the GetRadWindow() function is present in the content page and then to call GetRadWindow().close() instead of radalert().

For convenience I attached to this thread a small sample that shows one of the approaches.


Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ash
Top achievements
Rank 1
answered on 18 Sep 2008, 09:43 AM
Hi Georgi
Many thanks for the example. Great!! Now that i am able to close the rad window.This definetly is right answer for my query.
However i have another query regarding this..all i am doing is i have an ascx control(Units.ascx) inside aspx page(Contact.aspx) that contains a rad grid. on the add new record i open another ascx control(UnitDetail.ascx) that contains a link .On click of this link i open a rad window that contains another rad grid.(ListUnits.ascx) .Since we cannot open an ascx control directly in rad window therefore i am opening this inside an aspx page(ShowControl.aspx) and calling ths page when i click the link button. All i want is on close of rad window , i can update the drop down list in the UnitDetail.ascx with the name/id passed from the rad window.

I have been trying to achieve this all these days. I have seen that we can save the value in session variable in order to access it back. Is there any other way to return back value from rad window. morever the critical thing is i want to refresh the drop down on close of rad window and add the item with new value.But when i close the window nothing fires in the UnitDetail.ascx page where i can capture and refresh the drop down.

It woud be deeply appreciated if Telerik can tell me way for doing this.Any example would be helpful.

I am using ASP.net 2.0 and telerik version as RadControls for ASPNET AJAX Q1 2008 with IE7. Also the programming language i intend to use is c#

Many thanks
Best Regards
Ash
0
Svetlina Anati
Telerik team
answered on 19 Sep 2008, 01:01 PM
Hi Ash,

You can return values from RadWindow by using its Argument property as shown in this online demo. After that, you can perform a postback and pass the value to the server by using the __doPostBack function.

Best wishes,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Ash
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Ash
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or