5 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 30 Jun 2009, 01:43 PM
Hello Kevin,
Try the following code snippet in order to close the RadWindow from code behind of dialog page.
CS:
JavaScript:
Thanks,
Shinu
Try the following code snippet in order to close the RadWindow from code behind of dialog page.
CS:
protected void Button1_Click(object sender, EventArgs e) |
{ |
string script = "<script language='javascript'type='text/javascript'>Sys.Application.add_load(CloseWindow);</script>"; |
ClientScript.RegisterStartupScript(this.GetType(), "Close", script); |
} |
JavaScript:
<script type="text/javascript"> |
function CloseWindow(sender, args) |
{ |
GetRadWindow().close(); //closes the window |
} |
function GetRadWindow() //Get reference to window |
{ |
var oWindow = null; |
if (window.radWindow) |
oWindow = window.radWindow; |
else if (window.frameElement.radWindow) |
oWindow = window.frameElement.radWindow; |
return oWindow; |
} |
</script> |
Thanks,
Shinu
0
Kevin
Top achievements
Rank 1
answered on 30 Jun 2009, 02:08 PM
Hi Shinu
i have put that into my code but im now getting an object not defined error when i try to run it
thanks
Kevin
i have put that into my code but im now getting an object not defined error when i try to run it
thanks
Kevin
0
Phil
Top achievements
Rank 2
answered on 30 Jun 2009, 07:14 PM
Hi:
The above is placed in the windowed form. Not the parent. I use a variant of the above, using ScriptManager instead of ClientScript ... thusly, I do not need the <script> tags:
The above is placed in the windowed form. Not the parent. I use a variant of the above, using ScriptManager instead of ClientScript ... thusly, I do not need the <script> tags:
Protected Sub CloseForm() |
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Close", "GetRadWindow().Close();", True) |
End Sub |
0
Hi Kevin,
I believe that the following links will be of help as well:
Greetings,
Fiko
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.
I believe that the following links will be of help as well:
- http://demos.telerik.com/aspnet-ajax/window/examples/radwindowobject/defaultcs.aspx
- http://blogs.telerik.com/blogs/09-05-05/executing_javascript_function_from_server-side_code.aspx
- http://www.telerik.com/support/kb/aspnet-ajax/window/calling-radalert-from-codebehind.aspx
Greetings,
Fiko
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.
0
Hi Kevin,
I believe that the following links will be of help:
Greetings,
Martin Ivanov
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.
I believe that the following links will be of help:
- http://demos.telerik.com/aspnet-ajax/window/examples/radwindowobject/defaultcs.aspx
- http://blogs.telerik.com/blogs/09-05-05/executing_javascript_function_from_server-side_code.aspx
- http://www.telerik.com/support/kb/aspnet-ajax/window/calling-radalert-from-codebehind.aspx
Greetings,
Martin Ivanov
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.