radmenu error from radwindow that has already closed?

2 posts, 0 answers
  1. Steven
    Steven avatar
    32 posts
    Member since:
    Jul 2012

    Posted 15 Aug 2012 Link to this post

    I've got a web page with a script that opens  radwindows for me with an onclose .


    function openPatientDemoWin(url, title, AddOnClose, OnCloseMethod) {
        var Wnd = radopen(url, 'frank');
        Wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Resize);
        if (AddOnClose == '1') {
        return false;




    The radwindow has a radgrid with a radmenu. 

    this is the radmenu in the radgrid, the items are added in the codebehind so I can attach attributes to them

    <telerik:RadMenu ID="RadMenu1" runat="server"
    <telerik:RadMenuItem ImageUrl="/images/icon_actionmenu.gif" BorderStyle="None" BorderWidth="0px" >
    <GroupSettings ExpandDirection="Right" ></GroupSettings>

    These are the scripts on the radwindow that close and pass back arguments for me
    <script type="text/javascript">
         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 RadMenu1_onClicked(sender, args) {
             var item = args.get_item();
             var MenuItem = item.get_attributes().getAttribute("MenuItem");
             var DueDateID = item.get_attributes().getAttribute("DueDateID");
             var oArg = new Object();
             oArg.MenuItem = MenuItem;
             oArg.DueDateID = DueDateID;
             var oWnd = GetRadWindow();

    this is the script on the parent window that handles the onclose method
    function Archive_OnClose(oWnd, args) {
        var arg = args.get_argument();
        if (arg) {
            switch (arg.MenuItem) {
                case '17P':
                case 'RISK':
                case 'PH':
                    window.location = '/OB/OBAssessmentsList.aspx?AM=wfe34tgsdge4&ADD=' + arg.DueDateID;

    the problem I am having is after the Archive_OnClose finishes I am getting the following error and am not sure how to get rid of it. By the time this error occurs, the radwindow has already closed and the onclose method has already fired so not sure why it is happening. All the debuggers have been hit

    the error is on the last line and its
    Microsoft JScript runtime error: '$telerik' is undefined

  2. Kate
    Kate avatar
    1898 posts

    Posted 20 Aug 2012 Link to this post

    Hi Steven,

    The error that you get most probably occurs because some of the controls can not load the scripts needed for the controls to work properly. Please take a look at the following help article where you can find more explanation how to workaround the exception that you get - General Troubleshooting

    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top