How do I call a client script in radwindow masterpage?

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

    Posted 28 Jun 2013 Link to this post

    this works great when I want to run the script TestWbform1 on my radwindow


    function Test2(arg0, arg1, arg2, arg3, arg4) {
        var oWnd = $find("<%=AssmntContentWindow.ClientID%>");
        oWnd.get_contentFrame().contentWindow.TestWbform1(arg0, arg1, arg2, arg3, arg4);


    if I place the script in the masterpage of my radwindow, it no longer works. Can you tell me how to access it there?

  2. Marin Bratanov
    Marin Bratanov avatar
    5529 posts

    Posted 02 Jul 2013 Link to this post

    Hi Steven,

    This is a matter of accessing the control in a separate context. The server code blocks (<%= .... %> syntax) are executed in the context of the file currently being rendered so the AssmntContentWindow control that is declared on the content page is not directly accessible on the master page.

    There are several ways to access it and you can choose the one that fits your style, scenario and needs best. Note that the following list cannot be complete and there may be other ways to achieve this:
    - create a function that will return the desired popup. It will be in the markup of the content page and will simply do return $find("<%=AssmntContentWindow.ClientID%>"); while on the master page you will call this function instead of $find().
    - if the RadWindow is in a RadWindowManager - use the client-side API of the RadWindowManager - the getWindowByName() method and pass the server ID of the control (AssmntContentWindow)
    - examine this blog post  that is a bit of a mix from the two approaches

    Marin Bratanov
    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 the blog feed now.
Back to Top