问题
I am working with Asp.Net 3.5 and Ext.Net 1.0. I had created One Master Page(Site.master) and one content page(User.aspx) in my Application and I am loading one page(UserManager.aspx) into content page
If I put normal HTML tags into UserManager.aspx that works fine but if i put EXt.NET controls in it I wont work..
MasterPage
<ext:Panel ID="Panel6" runat="server" Region="Center" CollapseMode="Mini" Margins="0 0 4 4">
<Content>
<asp:ContentPlaceHolder ID="cntMainCenter" runat="server">
</asp:ContentPlaceHolder>
</Content>
</ext:Panel>
ContentPage
<ext:ButtonGroup ID="ButtonGroup1" runat="server" Title="" Columns="3">
<Items>
<ext:SplitButton ID="SplitButton1" runat="server"
Text="Users" IconCls="add" IconAlign="Top"
ArrowAlign="Bottom" Width="60" Scale="Large" RowSpan="3">
<Listeners>
<Click Handler="#{panel}.load('UserManager.aspx');" />
</Listeners>
</ext:SplitButton>
</Items>
</ext:ButtonGroup>
I am Loading UserManager.aspx Page in content on click of Content Page's Split Button.
<asp:Content ID="Content2" ContentPlaceHolderID="cntMainCenter" runat="server">
<ext:Panel runat="server" ID="panel" BodyBorder="false" Border="true" Title="Panel" >
<Items>
</Items>
</ext:Panel>
</asp:Content>
UserManager Page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="SPA_SCHEDULER.test" %> <%@ 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></title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
<ext:Panel runat="server" Title="dfdf" Height="100" Width="100">
</ext:Panel>
</body>
</html>
If I write HTML Tags instead of EXT.Panel in UserManager.aspx page it will work fine but if i write EXT.NET any control it will not loaded.
回答1:
You have to use iFrame or Merge mode for this. http://examples1.ext.net/#/Panel/Basic/AutoLoad/
I recommend you use iFrame mode, it's simple and very easy to use.
For example try this:
#{panel}.load({ url:"UserManager.aspx",scripts:true,mode:"iframe",showMask:true });
来源:https://stackoverflow.com/questions/10346254/loading-another-page-in-content-page-is-not-working-in-asp-net-with-ext-net