GetRadWindowManager and $find()

8 posts, 0 answers
  1. Robert
    Robert avatar
    1 posts
    Member since:
    Oct 2007

    Posted 03 Nov 2007 Link to this post


    I have been unsuccessful in obtaining a reference to the RadWindowManager via the GetRadWindowManager or the $find() calls.

    $find returns null and GetRadWindowManager returns undefined.

    Any help would be greatly appreciated.

    Thanks in advance,

    1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
    2<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ""> 
    5<html xmlns=""
    6<head runat="server"
    7    <title>Untitled Page</title> 
    9    <script language="javascript" type="text/javascript">   
    11            function OpenWindow(name) 
    12            { 
    13                alert(name); 
    15                var mgr =  $find('RadWindowManager1'); // GetRadWindowManager(); 
    17                var wnd ="", null);          
    19                return false; 
    20            }   
    22    </script> 
    27    <form id="form1" runat="server"
    28        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
    29        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    30            <Windows> 
    31                <telerik:RadWindow ID="RadWindow1" runat="server"
    32                </telerik:RadWindow> 
    33            </Windows> 
    34        </telerik:RadWindowManager> 
    37        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />       
    38        <asp:Label ID="InjectScript" runat="server" Text=""></asp:Label> 
    40    </form> 

    protected void Button1_Click(object sender, EventArgs e) 
            InjectScript.Text = "<script type='text/javascript'>OpenWindow('RadWindowServicePopup')</script>"

  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 05 Nov 2007 Link to this post

    Hello Robert,

    You need to make sure that the page will be fully loaded and the RadWindowManager is rendered on the page before you call the Javascript.
    In ASP.NET AJAX environment this can be done by registering to the Sys.Application.load() event:

    protected void Button1_Click(object sender, EventArgs e)    
        InjectScript.Text = "<script type='text/javascript'>Sys.Application.add_load(function(){OpenWindow('RadWindowServicePopup')})</script>";    

    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
  4. Joseph Roberts
    Joseph Roberts avatar
    47 posts
    Member since:
    Jul 2004

    Posted 28 Feb 2008 Link to this post

    I'm having the same problem as stated above, but in my case I am creating a server control that will load a RadWindow.  The page the server controls is on has a RadWindowManager on it.  I can't get access to the RadWindowManager through script, it keeps coming up undefined.  I tried the suggestiong to use the Sys.Application.add_load, but now I'm getting an error that 'Sys' is undefined. 

    Any ideas?
  5. Joseph Roberts
    Joseph Roberts avatar
    47 posts
    Member since:
    Jul 2004

    Posted 28 Feb 2008 Link to this post

    Solved my own problem.  Was trying to inject the script by RegistringClientScriptBlock.  That did not work, I just added the script to a label control added to the page. 
  6. Peter Pyc
    Peter Pyc avatar
    2 posts
    Member since:
    Nov 2009

    Posted 08 Dec 2009 Link to this post

    Hi, Just want to say thanks.
    This post fixed my problem.
    I'm blown away by the level of support.
    Keep it up.
  7. G W
    G W avatar
    10 posts
    Member since:
    Dec 2009

    Posted 06 Jan 2010 Link to this post

    I had similar symptoms (everything was returning undefined or null) and came across this thread, but nothing was helping.

    My problem was a really simple stupid one:  All the objects need to be inside the <form> tags (RadWindowManager, RadScriptManager, and any calls to Sys.Application.add_load()).  Other javascript can be outside of it, it seems, but not the Sys calls.

    A previous developer who worked on this page that I am trying to convert to the ajax controls combined the page with the master page code, and what they ended up doing is putting all the master page code outside of the <form> tags.

    Posting here to hopefully remind anyone of this possibility if they run into a poorly pieced together page like I did here.
  8. kavitha
    kavitha avatar
    16 posts
    Member since:
    Mar 2008

    Posted 26 Nov 2010 Link to this post

    Thank you GW. Putting all the objects  inside the <form> tags solved my problem.
    Thank you very much for your solution.
  9. Jasfer
    Jasfer avatar
    1 posts
    Member since:
    Feb 2013

    Posted 11 Feb 2013 Link to this post

    Hi ,

    I had the same issue and javascript Sys.Application.add_load solved my problem..Thanks a lot.i been scratching my head for two days because of this problem finally solved ...thanks...
Back to Top
DevCraft R3 2016 release webinar banner