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

ascx opens a RadWindow with a ascx in it, but where did my window go?

1 Answer 88 Views
Window
This is a migrated thread and some comments may be shown as answers.
Henrik Tegman
Top achievements
Rank 1
Henrik Tegman asked on 04 Oct 2010, 03:56 PM
Hi,

I'm going to try and explane this as good as I can.
I have a ascx, it's very simple it only has a dropdown and some buttons.
When I click on one of the buttons I want to open a one of my aspx sites in/with a RadWindow, this works fine.
This aspx site has a diffrent ascx in it, and when I press a button in this ascx I want the RadWindow to close, faily simple.

But I have a big problem in geting the RadWindow to close.
I can ofcourse just press the red X, but I want the window to close automaticly when the user presses another button.

My RadWindowManager is located inside the first ascx, that ascx opens a aspx that contains a ascx, when the user presses a button in that ascx I want the RadWindow to close.

Lets give them some names:

DropDown.ascx (has the RadWindowManager a dropdown and a button that opens up Editor.aspx)
Editor.aspx (has the Fields.ascx control)
Fields.ascx (a control with a lot of fields that can be edited and a save button)

When the user presses that save button my codebehind in Editor.aspx catches this, it checks how the save goes and then I simply want that codebehind todo something like RadWindow1.Close().

I simply can't find or get a hold of the RadWindow from Editor.aspx

I've tried with Parent or FindControl or similar things, but I simply can't find it, and I don't know how to go on with this, how I can change it. Please help me.

Thanks for your help.

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 07 Oct 2010, 11:02 AM
Hello Henrik,

If the RadWindow control shows external page, different from the parent one, you can close that RadWindow by getting a reference to it on the client and then call its close() method. This is needed because the RadWindow object is actually on the different page - the parent one and you cannot access it directly from the content one.

e.g.
function GetRadWindow()
{
  var oWindow = null;
  if (window.radWindow)
     oWindow = window.radWindow;
  else if (window.frameElement.radWindow)
     oWindow = window.frameElement.radWindow;
  return oWindow;
}     
 
function closeWin()
{
   GetRadWindow().close()
}

The following blog post will give you more information about how to fire a JavaScript function from server-side code
http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx


Best wishes,
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
Tags
Window
Asked by
Henrik Tegman
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or