This is a migrated thread and some comments may be shown as answers.

Reference RadWindow in previous page

1 Answer 45 Views
Window
This is a migrated thread and some comments may be shown as answers.
Richard M
Top achievements
Rank 1
Richard M asked on 23 Jun 2010, 05:36 PM

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")

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2010, 12:40 PM
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.
Tags
Window
Asked by
Richard M
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or