将aspx页面加载到<ext:panel> </ext:panel>

时间:2014-02-27 10:15:01

标签: javascript asp.net extjs ext.net

我有两个aspx页面: Coba.aspx Coba2.aspx 。我想加载一个aspx页面。页面加载到面板,但浏览器挂起,我在控制台中总是有这样的错误:

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

此处 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>

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>

任何人都可以帮助解决这个问题?

1 个答案:

答案 0 :(得分:2)

应该是

renderer: 'frame'

而不是

mode: 'frame'