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

Radwindow wont close with javascript

2 Answers 63 Views
Window
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 16 May 2013, 07:45 PM
good afternoon
I have and issue closing a radwindow with javascript
I'm using:
<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 Close() {
               GetRadWindow().close();
           }
 
       </script>
Which I know it works because when I put the code below in a button it closes the radwindow
ClientScript.RegisterStartupScript(Me.GetType(), "", "Close();", True)

my problem is that I have a toolbar with a button running the above code, it only refreses the content which in the radwindow but it doesnt close the radwindow (the toolbar is inside a radsliding panel). Please help.
Thanks

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 May 2013, 09:39 AM
Hi,

I have just answered your support ticket with the same question and I am adding the information here as well.

How exactly does the toolbar execute this code? It is possible that its client-side event handler is not attached properly and therefore the toolbar simply posts the page.


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Steven
Top achievements
Rank 1
answered on 22 May 2013, 07:33 PM
Hi Marin,
It works now I had to use this 
ScriptManager.RegisterStartupScript(Me, GetType(String), "myscriptId", "closeWnd();", True)
Thanks for your help.
Tags
Window
Asked by
Steven
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Steven
Top achievements
Rank 1
Share this question
or