Accessing content through custom titlebar button.

2 posts, 0 answers
  1. jowell
    jowell avatar
    2 posts
    Member since:
    Apr 2011

    Posted 12 Aug 2011 Link to this post

    I'm using this example

    to add a custom dismiss button to a RadWindow that loads an aspx.

    I cannot get access to content via the function 
        A.onmousedown = printWin; 
       as shown in the kb article.

    I can use %find and jquery selectors to access the content when using the same function when responding to a mouse click on the page itself, but NOT when I use the custom button from the title bar.


  2. Marin Bratanov
    Marin Bratanov avatar
    4614 posts

    Posted 16 Aug 2011 Link to this post

    Hello Jowell,

    Please make sure that your printWin(e) function is the same as the one in the KB article, at least its beginnig where the reference to the document object of the content page is obtained:
    1) you need a reference to the RadWindow, as this button's context is actually the main page. This is one way to do it:
    var oManager = GetRadWindowManager();
    var oWnd = oManager.GetWindowByName("RadWindow1");
    or you can use:
    var oWnd = $find("<%=RadWindow1.ClientID %>");

    2) you need to access its content frame (i.e. the iframe where the page's document object is located:
    var content = oWnd.GetContentFrame().contentWindow;
    This is explained in greater detail in this help article on accessing RadWindows.

      3) the content object now holds a reference to the window object of the iframe, holding your page, thus you should be able to access the document object as well. This means that if all your references above are correct and the content page in the RadWIndow comes from the same domain this approach should work.

    Please examine the above information, the KB article (and the project attached in it) and the linked help article and try to locate any major differences that may be resulting in your difficulty. If you are still unable to resolve this situation I would advise that you open a new support ticket and send us a simple project isolating your issue so we can investigate it further.

    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top