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

Easy way to open and close radWindow

5 Answers 104 Views
Window
This is a migrated thread and some comments may be shown as answers.
wilson
Top achievements
Rank 1
wilson asked on 24 Dec 2010, 05:10 PM
I did some search and looks like opening the radWindow is eash, just use "RadWindow1.VisibleOnPageLoad = True" on a button click will do the trick.

But closing the window is complicate.  Why do I have to use javascript to close it?  Is there an easier way to close it after postback?

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Dec 2010, 05:43 AM
Hello,



You could invoke a client method (which includes code for closing window) from code behind.

Checkout the following forum links for similar scenarios:
Close RadWindow From Server?
Closing RadWindow
Close RadWindow from RadWindow using server-side code



-Shinu.
0
Svetlina Anati
Telerik team
answered on 29 Dec 2010, 05:03 PM
Hi wilson,

 The reason that the RadWindow should be closed from the server is that it is entirely created on the client, dynamically, by using lazy initialization. However, executing a script from the server is a general task which is not only used with RadControls but in general ASP.NET as well. I recommend to examine the following blog post we have prepared:

http://blogs.telerik.com/blogs/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx

In case you face any problems, do not hesitate to contact us again with more details about the issue and we will do our best to help.

Greetings,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
wilson
Top achievements
Rank 1
answered on 30 Dec 2010, 05:27 PM
Hi,
  I am getting confused.  Did you mean "The reason that the RadWindow should be closed from the server"?  Then how come there is no service side method, like radWindow.close() to close the window?
0
wilson
Top achievements
Rank 1
answered on 30 Dec 2010, 05:38 PM
Hi,
  Also, I am using the rad window as a controls container.
  So when user click on a button, I want to open the rad window.  Then there is a close button in the rad window and user can click the button to close it.
  I check your demo at: http://demos.telerik.com/aspnet-ajax/window/examples/internalcontent/defaultcs.aspx, but it keeps the rad window open on the page, so I can't really use it. 
 
0
Svetlina Anati
Telerik team
answered on 03 Jan 2011, 03:52 PM
Hello wilson,

 For your convenience and to better illustrate what I meant I prepared and attached a sample page for you - please examine it and let me know how it goes.

All the best,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
wilson
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Svetlina Anati
Telerik team
wilson
Top achievements
Rank 1
Share this question
or