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

RadWindow and IFrame Sandbox

1 Answer 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
reza
Top achievements
Rank 1
reza asked on 29 Mar 2013, 03:36 PM
Hi

I use 'RadWindowManager' and 'radopen' javadcript function to open and brows extra pages.
How can I add [sandbox="allow-forms allow-scripts"] to the iframe of the radwindow?

Thank you very much

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 01 Apr 2013, 02:45 PM
Hi Reza,

You can get a reference to the iframe in the RadWindow by using the control's Client-side API:
var oWnd = radopen(url, wndName);
if(oWnd.get_contentFrame()){
  oWnd.get_contentFrame().setAttribute("sandbox", "allow-forms allow-scripts");
}

Note that the popup must be shown already in order to have its iframe created. Thus, the earliest point where the if block can be added is the OnClientShow event. The event handler can be set for the manager if you want it for all RadWindows. The event handler would receive the RadWindow instance as its first parameter, so you can use that.

All the best,
Marin Bratanov
the Telerik team
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 their blog feed now.
Tags
General Discussions
Asked by
reza
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or