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

Closing a RadWindow from a user control in the loaded page

1 Answer 59 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andrei
Top achievements
Rank 1
Andrei asked on 14 May 2009, 10:51 AM
Hi there!

I've run into a bit of a snag. I have a modal RadWindow that loads an aspx page containing just a user control. Inside that user control I have a button and I want to close the RadWindow when I press it. Any ideas how that could be accomplished?

Thanks,
Andrei

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 14 May 2009, 11:40 AM
Hello Andrei,

I would suggest to use the client-side API of the RadWindow and to get a reference to the window wrapper and call its close() method.
e.g.
<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 closeWin() 
    //get a reference to the RadWindow 
    var oWnd = GetRadWindow(); 
    //call its close() method 
    oWnd.close(); 
</script> 
<asp:button id="Button1" runat="server" text="Close Window" OnClientClick="closeWin(); return false;"



Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Andrei
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or