简体   繁体   English

将aspx页面加载到<ext:Panel>

[英]Load aspx page into <ext:Panel>

I have two aspx page: Coba.aspx and Coba2.aspx . 我有两个aspx页面: Coba.aspxCoba2.aspx I want to load an aspx page into . 我想加载一个aspx页面。 The Page is load to the panel, but browser getting hang and I always have error like this in console: 页面加载到面板,但浏览器挂起,我在控制台中总是有这样的错误:

Uncaught TypeError: Object prototype may only be an Object or null

Here Coba.aspx 在这里Coba.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Coba.aspx.cs" Inherits="Coba" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var nm = {
            Add: function () {
                var panel1 = Ext.getCmp('Panel1');
                var child = {
                    xtype: 'panel',
                    layout: 'fit',
                    closable: true,
                    title: 'title',
                    autoLoad: {
                        showMask: true,
                        scripts: true,
                        mode: 'frame',
                        url: 'http://localhost:34573/CBC/Coba2.aspx'
                    }
                };
                panel1.add(child);
            }
        };
    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" DirectMethodNamespace="X" IDMode="Explicit" />
    <ext:Viewport ID="Viewport1" runat="server">
        <Items>
            <ext:Button ID="Button" runat="server" Text="Button">
                <Listeners>
                    <Click Fn="nm.Add">
                    </Click>
                </Listeners>
            </ext:Button>
            <ext:Panel ID="Panel1" runat="server" Layout="FitLayout">
            </ext:Panel>
        </Items>
    </ext:Viewport>
</body>
</html>

and Coba2.aspx is Coba2.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Coba2.aspx.cs" Inherits="Coba2" %>

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

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" />
    <div>
        This is Coba2
    </div>
    </form>
</body>
</html>

Anyone can help this problem? 有谁可以帮助这个问题?

Should be 应该

renderer: 'frame'

instead of 代替

mode: 'frame'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM