PDA

View Full Version : [CLOSED] [Razor] Setup Auto load panel in razor



UnifyEducation
Apr 27, 2012, 9:24 AM
Hi dev team,
I try to create Panel with autoload( Loader in version 2.0) and this is my code:

Html.X().Panel()
.Region(Region.Center)
.ID("centerPanel")
.Height(600)
.Title("Home")
.AutoDoLayout(true)
.Loader(new ComponentLoader {
AutoLoad = true,
DisableCaching = true,
Url = "http://google.com",
ReloadOnEvent = true
})

Nothing happened, when I open Google Chrome Debug Console, it show an error:

7Refused to display document because display forbidden by X-Frame-Options.

Please check this for me. And how to reload panel with new url? My javascript function:



function loadContent(title, url) {

App.centerPanel.load({
url: url,


disableCaching: true,
text: "Loading...",

timeout: 30,


scripts: true,
mode: 'iframe'



});
App.centerPanel.setTitle(title);


}
Same error display in Chrome debug console:

Refused to display document because display forbidden by X-Frame-Options.

Thanks and best regards,

Daniil
Apr 27, 2012, 10:54 AM
Hi,

Just Google prevents its site to be loaded into iframe.

Here is the example with Ext.NET and Ext.NET forums site which are allowed to be loaded into iframe.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:Panel ID="Panel1" runat="server" Width="400" Height="400">
<Loader runat="server" Url="http://ext.net" />
</ext:Panel>

<ext:Button runat="server" Text="Load Ext.NET forums">
<Listeners>
<Click Handler="App.Panel1.load({
url : 'http://forums.ext.net'
});" />
</Listeners>
</ext:Button>
</body>
</html>