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

RadButton OnClientClicked Event: Microsoft JScript runtime error: '$telerik' is undefined

4 Answers 290 Views
Button
This is a migrated thread and some comments may be shown as answers.
Casey
Top achievements
Rank 1
Casey asked on 06 Dec 2011, 09:00 PM
Hello All,

I get the following error when I click on my RadButton: "Microsoft JScript runtime error: '$telerik' is undefined." Here is how my RadButton is setup:

<telerik:RadButton ID="rbtnCancel" runat="server" Text="Return to Forms Central" OnClientClicked="btnCloseWin" Font-Names="Arial" Font-Size="Medium" AutoPostBack="false">
</telerik:RadButton>

Here are the Javascript functions:
function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
        return oWindow;
    }
 
function btnCloseWin(sender, eventArgs) {
        var oWindow = GetRadWindow();
        oWindow.Close();
    }


The following code is where the error is shown: var e=$telerik.isMouseOverElementEx(this.get_element(),i);

When I continue with debugging the program, the RadWindow is closed, but I'm not sure why I am getting this error at all. I am able to close the RadWindow using the Javascript function just fine from an asp:Button.

I'd greatly appreciate any insight into why this is happening.

Thanks!
Casey

4 Answers, 1 is accepted

Sort by
0
Casey
Top achievements
Rank 1
answered on 07 Dec 2011, 06:02 PM
I am using IE9 version 9.0.8112.16421. If I turn on compatibility view, I do not get the javascript error.

Thanks,
Casey
0
Accepted
Slav
Telerik team
answered on 09 Dec 2011, 01:17 PM
Hi Casey,

I tried to reproduce the described problem, but without success. You can find attached my sample, which I used for testing the issue. Please compare it with your project and check if there are differences in the setup. I have added a short video, demonstrating the behavior on my end.

Note that I am willing to help, but I will need to reproduce the problem, so that I can suggest a more to the point answer. If you are still having difficulties, please open a support ticket and send us either a modified version of the attached sample so that the issue is reproducible or a simple, runnable project that isolates the problem so that we can examine it locally and provide a working solution. 

Best wishes,
Slav
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
Casey
Top achievements
Rank 1
answered on 09 Dec 2011, 04:11 PM
Hello Slav,

I just submitted a support ticket with a modified version of the project you provided.

Thanks!
Casey
0
Casey
Top achievements
Rank 1
answered on 12 Dec 2011, 05:53 PM
Here is the response I received from Telerik. Hopefully this will help anybody else having the same issue I was having.

--------------------------------------------------------------------------------
Hi Casey,

Thank you very much for the provided sample project! Now I am able to reproduce your problem and I can suggest a working solution. 

The encountered issue stems from the way IE9 handles (and more specifically - disposes) iframes. The lifecycle under this browser is different and the iframe (which is used for rendering the content of the RadWindow) actually does not dispose properly. We are aware of this behavior and if a viable solution is found it will be incorporated in the RadWindow code.

For the time being you can use a simple workaround that will not affect the performance and functioanlity of your page:
function btnCloseWin(sender, eventArgs) {
    var oWindow = GetRadWindow();
    setTimeout(function () {
        oWindow.Close();
    }, 0);
}

This issue is encountered only when the property DestroyOnClose of the RadWindow is set totrue. If it is not needed in your scenario, I would suggest removing it.

Feel free to contact us again if you run into more difficulties.

Regards,
Slav 
the Telerik team

--------------------------------------------------------------------------------
Tags
Button
Asked by
Casey
Top achievements
Rank 1
Answers by
Casey
Top achievements
Rank 1
Slav
Telerik team
Share this question
or