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

Microsoft JScript runtime error: Object doesn't support property or method 'radopen'

1 Answer 223 Views
Window
This is a migrated thread and some comments may be shown as answers.
AAA
Top achievements
Rank 1
AAA asked on 11 Mar 2013, 03:04 PM
I am attempting to open a radWindow from C# codebehind (using VS 2008, Telerik.Web.UI version 2012.2.724.35), however, I am getting this error:

Microsoft JScript runtime error: Unable to get value of the property 'open': object is null or undefined

My aspx code is:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>


<script type="text/javascript">
    function OpenRadWindow() {
        var wnd = window.radopen("http://www.microsoft.com", null);
        wnd.setSize(300, 400);
        return false;
    }
</script>

The serverside code is: 
protected void Page_Load(object sender, EventArgs e)
{
    Page.ClientScript.RegisterStartupScript(this.GetType(), "getting data", "OpenRadWindow();", true);
}

What is causing the error?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 12 Mar 2013, 11:09 AM
Hi,


I advise that you examine the following sticky thread on opening a RadWindow from the server: http://www.telerik.com/community/forums/aspnet-ajax/window/opening-radwindow-from-the-server.aspx. It explains how injecting a script is done properly by using the Sys.Application.Load event. With the current snippet the script is executed too early for the script controls to have been initialized.


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.
Tags
Window
Asked by
AAA
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or