使用 frameset 會出現 Ext.fly(...) is null or not an object

Feb 24, 2011 at 9:39 AM

Hello, 問題是這樣的, 我們想要在舊系統的架構上使用 ExtAspNet, 所以就沿用舊程式使用 frameset 的寫法

http://localhost/Demo2/Default.aspx(這是採用 ExtAspNet 的 Page), 直接運行是正常的

 

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

<!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 id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" runat="server"/>
    <ext:PageLoading ID="PageLoading1" runat="server">
    </ext:PageLoading>
        
    <!-- Test Ext:Tree -->       
    <div id="div1" style="background-color:green;">  
    <ext:Tree ID="Tree2" Width="500px" ShowHeader="true" Title="Tree(Inline)" runat="server">
        <Nodes>
            <ext:TreeNode Text="China" Expanded="true">
                <Nodes>
                    <ext:TreeNode Text="Henan" EnableCheckBox="true" Expanded="true" Target="div1">
                        <Nodes>
                            <ext:TreeNode Text="Zhumadian(Click to postback)(AutoPostBack CheckBox)" EnablePostBack="true"
                                CommandName="HENAN" CommandArgument="zmd" EnableCheckBox="true" Checked="true"
                                AutoPostBack="true" Icon="Anchor" NodeID="zhumadian">
                                <Nodes>
                                    <ext:TreeNode Text="Suiping Xian" Leaf="false" NodeID="suiping">
                                        <Nodes>
                                            <ext:TreeNode Text="Huaishu Xiang" Leaf="false" NodeID="huaishu">
                                                <Nodes>
                                                    <ext:TreeNode Text="Chenzhuang Cun" Leaf="true" NodeID="chenzhuang">
                                                    </ext:TreeNode>
                                                </Nodes>
                                            </ext:TreeNode>
                                        </Nodes>
                                    </ext:TreeNode>
                                </Nodes>
                            </ext:TreeNode>
                            <ext:TreeNode Text="Luohe(Click to postback)" Enabled="true" EnableCheckBox="true"
                                EnablePostBack="true" CommandName="HENAN" CommandArgument="lh" NodeID="luohe"
                                Leaf="true"  Target="_self"/>
                        </Nodes>
                    </ext:TreeNode>
                    <ext:TreeNode Text="Anhui" Expanded="true" NodeID="anhui">
                        <Nodes>
                            <ext:TreeNode Text="Hefei" NodeID="hefei">
                                <Nodes>
                                    <ext:TreeNode Text="Golden Pond(this is link)" IconUrl="~/images/16/1.png" ToolTip="This is tooltip."
                                        NavigateUrl="http://www.google.com/search?q=%E9%87%91%E8%89%B2%E6%B1%A0%E5%A1%98+%E5%90%88%E8%82%A5" Target="_blank" NodeID="microsoft" Leaf="true">
                                    </ext:TreeNode>
                                    <ext:TreeNode Text="USTC" Leaf="true" NodeID="ustc" EnableCheckBox="true" Checked="true">
                                    </ext:TreeNode>
                                </Nodes>
                            </ext:TreeNode>
                        </Nodes>
                    </ext:TreeNode>
                </Nodes>
            </ext:TreeNode>
        </Nodes>
    </ext:Tree>
    </div> 
    <br />


    <ext:SimpleForm ID="Form2" Title="SimpleForm" runat="server" ShowBorder="True" LabelWidth="100px"
        Width="650px" EnableBackgroundColor="true" BodyPadding="5px" ShowHeader="True">
        <Items>
            <ext:DropDownList Label="DropDownList1" runat="server" ID="DropDownList1">
                <ext:ListItem Text="Text1" Value="Value1" Selected="true" />
                <ext:ListItem Text="Text2" Value="Value2" EnableSelect="false" Selected="true" />
                <ext:ListItem Text="Text3" Value="Value3" EnableSelect="false" Selected="true" />
                <ext:ListItem Text="Text4" Value="Value4" EnableSelect="false" Selected="true" />
                <ext:ListItem Text="Text5" Value="Value5" Selected="true" />
                <ext:ListItem Text="Text6" Value="Value6" Selected="true" />
                <ext:ListItem Text="Text7" Value="Value7" Selected="true" />
                <ext:ListItem Text="Text8" Value="Value8" Selected="true" />
            </ext:DropDownList>
        </Items>
    </ext:SimpleForm>

    
    </form>
</body>
</html>


另一個 Page (http://localhost/Demo1/FormUse.aspx)這個 Page 裡面使用 frameset 去連上一個 Page, 

畫面顯示正常, 但 Click Tree Node  or  Change DropDownList Value 時就會出現  Ext.fly(...) is null or not an object  的 javascript error

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

string browserType = Request.Browser.Type;
string browserVersion = Request.Browser.Version;
bool browserSupportsJavaScript = Request.Browser.JavaScript;

if ((browserType.Substring(0, 2).ToUpper() != "IE") || (Double.Parse(browserVersion)< 5.5))
{
    Response.Write("<script language=javascript>");
    Response.Write("alert('Web browser type or web browser version is not consistent! \\r\\rPlease use IE 5.5/6.0 web browser..');");
    Response.Write("window.close();");
    Response.Write("</script>");
    Response.End();
}
%>    


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
	<script type="text/javascript">
	    window.resizeTo(1004, 722);
	</script>
</head>

<!--frameset begin here-->
<frameset id="fs1" rows="*" border="0" frameborder="no" frameSpacing="0">
    <frame scrolling="auto" src="http://localhost/Demo2/Default.aspx" name="eform_new" id="eform_new">
</frameset>  
<!--frameset end-->

</html>
環境為 Server 2003 + IIS6 + VS2008, ExtAspNet 為 2.2.1(我測試過2.3.2一樣會錯),麻煩高手幫個忙了~~