Reference RadWindow in previous page

2 posts, 0 answers
  1. Richard M
    Richard M avatar
    76 posts
    Member since:
    Mar 2010

    Posted 23 Jun 2010 Link to this post


    I have a RadWindow1 (url: Page2.aspx) that is opened from Page1.aspx.  When a user clicks on a button on the RadWindow1, I want to remove the Move feature from the RadWindow1.  When I try to reference RadWindow1 from Page2.aspx.vb, it returns Nothing. How can I reference RadWindow1?



    I have a RadWindow1 (url: Page2.aspx) that is opened from Page1.aspx.  When a user clicks on a button on the RadWindow1, I want to remove the Move feature from the RadWindow1.  When I try to reference RadWindow1 from Page2.aspx.vb, it returns Nothing.  Here is the code I have tried:

            'Dim window_ProductCode As RadWindow = PreviousPage.FindControl("window_ProductCode")

            '------------------

            'If PreviousPage IsNot Nothing Then
               'Dim windowMgr As RadWindow = PreviousPage.FindControl("RadWindowManager1")
               'window_ProductCode.Behaviors = WindowBehaviors.None
            'End If

           '------------------

            'Dim window_ProductCode As RadWindow = Page.Parent.FindControl("RadWindowManager1")
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jun 2010 Link to this post

    Hello Richard,

    RadWindow is based on an IFRAME and by default it displays a content page set with the NavigateUrl property. Note that in this case, these are two completely different documents and you cannot access the server-side logic in one of the pages from the other one. But you can use the client-side api to access the parent page.

    You can also try another approach of directly obtaining the reference to the current window (from the client side button click where the button placed in RadWindow page) and setting the property from client-side.

    [Javascript] Obtaining a reference to the current window
     
    function GetRadWindow() 
      var oWindow = null
      if (window.radWindow) 
         oWindow = window.radWindow; 
      else if (window.frameElement.radWindow) 
         oWindow = window.frameElement.radWindow; 
      return oWindow; 

    After getting reference to RadWindow object use the set_behaviors method to set the Behaviors property of the RadWindow object.


    -Shinu.
Back to Top