[CLOSED] Thread: Problems with ext.panel and asp.Treeview

  1. #1

    [CLOSED] Thread: Problems with ext.panel and asp.Treeview

    Hi,

    I have to use asp.treeview as below in Ext.Panel but it is not working properly.

    <ext:Panel ID="divTreeView" runat="server" Border="true" Height="450" AutoScroll="true" BodyStyle="padding:10px;" meta:resourcekey="divTreeViewResource1">
     <Content>
    <asp:XmlDataSource ID="xmlDsTreeView" runat="server"></asp:XmlDataSource> <asp:TreeView ID="trvCodeTable" style="display:block" runat="server" Width="100%" ShowLines="true" ><%--OnSelectedNodeChanged="trvCodeTable_SelectedNodeChanged" onmousedown="TrvMouseDown(event);"--%> DataBindings> <asp:TreeNodeBinding DataMember="parent" ValueField="id" TextField="name" /> <asp:TreeNodeBinding DataMember="parentrow" ValueField="id" TextField="value" /> <asp:TreeNodeBinding DataMember="child" ValueField="id" TextField="name" /> <asp:TreeNodeBinding DataMember="childrow" ValueField="id" TextField="value" /> </DataBindings> </asp:TreeView>
    </Content> </ext:Panel>
    We cant see control within panel and it is not running properly Please guide us, as soon as possible.

    Thanks
    With Regards

    Niraj Dave
    Last edited by Daniil; Jun 27, 2011 at 1:08 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please provide A runnable full example like this one which works fine.

    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 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server" Height="100" Width="200">
                <Content>
                    <asp:TreeView runat="server">
                        <Nodes>
                            <asp:TreeNode Text="Node1" />
                            <asp:TreeNode Text="Node2" />
                            <asp:TreeNode Text="Node3" />
                        </Nodes>
                    </asp:TreeView>
                </Content>
            </ext:Panel>    
        </form>
    </body>
    </html>
  3. #3

    Problems with ext.panel and asp.Treeview and XML Data Source

    Hi Danill,

    When we use xmldatasource in asp:treeview and put this treeview in ext.net panel then display error as below:
    Webpage error details

    Error Message:
    -------------------------------------------------------------------------------------------------------------------------------
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
    Timestamp: Fri, 24 Jun 2011 08:19:32 UTC
    Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
    Line: 0
    Char: 0
    Code: 0
    URI: http://localhost:2745/Default.aspx
    -------------------------------------------------------------------------------------------------------------------------------
    This code working fine if we remove Ext.Net related tags from the following code sample.
    Remove following tags and run this (See http://www.java2s.com/Code/ASP/XML/B...sptreeview.htm).
    <ext:ResourceManager runat="server" />
        <ext:Panel runat="server" Height="100" Width="200">
            <Content>
            </Content>
        </ext:Panel>
    <%@ 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 id="Head1" runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Panel runat="server" Height="100" Width="200">
            <Content>
                <div>
                <div>
                <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1">
                    <DataBindings>
                        <asp:TreeNodeBinding TextField="Title" DataMember="book"></asp:TreeNodeBinding>
                        <asp:TreeNodeBinding TextField="name" DataMember="chapter"></asp:TreeNodeBinding>
                    </DataBindings>
                </asp:TreeView>
                </div>
                <div>
                <asp:XmlDataSource ID="XmlDataSource1" runat="server">
                    <Data>
                        <bookstore>
                        <book Title="title 1" Price="19.99">
                         <chapter num="1" name="Introduction"> A </chapter>
                         <chapter num="2" name="Body"> B </chapter>
                         <chapter num="3" name="Conclusion"> C </chapter>
                         </book>
                        <book Title="title 2" Price="24.95">
                         <chapter num="1" name="Introduction"> D </chapter>
                         <chapter num="2" name="Body"> E </chapter>
                         <chapter num="3" name="Conclusion"> F </chapter>
                         </book>
                         </bookstore>
                    </Data>
                </asp:XmlDataSource>
                </div>
                </div>
            </Content>
        </ext:Panel>
        </form>
    </body>
    </html>



    Quote Originally Posted by Daniil View Post
    Hi,

    Please provide A runnable full example like this one which works fine.

    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 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server" Height="100" Width="200">
                <Content>
                    <asp:TreeView runat="server">
                        <Nodes>
                            <asp:TreeNode Text="Node1" />
                            <asp:TreeNode Text="Node2" />
                            <asp:TreeNode Text="Node3" />
                        </Nodes>
                    </asp:TreeView>
                </Content>
            </ext:Panel>    
        </form>
    </body>
    </html>
    Last edited by Daniil; Jun 24, 2011 at 10:22 AM. Reason: Please use [CODE] tags for all code
  4. #4
    Thanks for the sample, but there is no error on my Firefox 4.0.1.

    What exactly is your Firefox version?
  5. #5

    Asp TreeView with ext.net panel and IE8 browser

    Hi Dannil,

    We are using Internet Explorer Version 8.0.6001.18702, .Net Framework 3.5 SP1 and Visual Studio 2008 SP1.

    We are can see treeview in IE8 but we cant expand or collapse tree node and also we cannot fire node clik event of asp.treeview.
    Also, Following error display in our IE8 browser. Also, we cannot bind xml datasource using Ext.Net DirectMethod.
    [DirectMethod]
    public sub BindTree()
    {
                string strXML = "<test><parent id=\"E5C96916-CC3F-455F-91B3-B64129F1D655\" name=\"City\"><parentrow id=\"6867517B-1296-4DBB-B8F1-13EFFA9C2148\" value=\"Ahmedabad\"></parentrow><parentrow id=\"FA99E197-5C4B-48E6-B475-9422E1E0D0DC~E5C96916-CC3F-455F-91B3-B64129F1D655\" value=\"Ahmedabad\"><child id=\"A34EA7ED-AE40-491D-922F-6F946A02BE0A\" name=\"Zip Code\"><childrow Id=\"74824400-598A-4565-ADFB-788192AB6D9B~A34EA7ED-AE40-491D-922F-6F946A02BE0A\" value=\"234423\"></childrow><childrow Id=\"19AD055B-330F-4B0A-9CF1-5515C69D8771~A34EA7ED-AE40-491D-922F-6F946A02BE0A\" value=\"234567\"></childrow><childrow Id=\"43280617-2C1D-46AD-85B5-6161CC1CE4DB~A34EA7ED-AE40-491D-922F-6F946A02BE0A\" value=\"380 006(InActive)\"></childrow><childrow Id=\"61FC87E8-F3B7-4DC6-8341-1C24969B9E12~A34EA7ED-AE40-491D-922F-6F946A02BE0A\" value=\"380 051(InActive)\"></childrow></child></parentrow><parentrow id=\"1656D943-FFA7-4518-A795-8378E2E278D6\" value=\"Baroda\"></parentrow><parentrow id=\"AB42122D-AD00-4C61-863E-5D9A12526C20\" value=\"Bengalooru\"></parentrow><parentrow id=\"58B6FEB3-1665-45F1-B00B-97CD2F591958\" value=\"Chennai\"></parentrow><parentrow id=\"5F6AB5CD-BC03-4A39-896B-7C2466A2B3B7\" value=\"Delhi\"></parentrow><parentrow id=\"50715FBE-BC2F-4ECC-B41B-CEB2F2CC969F\" value=\"Delhi\"></parentrow><parentrow id=\"6E1940AB-6ECF-44C6-85B1-B325D461050F\" value=\"Kolkata\"></parentrow><parentrow id=\"098D666A-7117-438E-A1C1-68B7DDBD7723\" value=\"Mumbai\"></parentrow><parentrow id=\"FCB93718-957E-4530-AD08-564B7816F57D~E5C96916-CC3F-455F-91B3-B64129F1D655\" value=\"Vadodara\"><child id=\"A34EA7ED-AE40-491D-922F-6F946A02BE0A\" name=\"Zip Code\"><childrow Id=\"C56C9BE3-1A21-4440-BBB6-87B9A1EB01BE~A34EA7ED-AE40-491D-922F-6F946A02BE0A\" value=\"365 001(InActive)\"></childrow></child></parentrow></parent></test>";
                xmlDsTreeView.Data = strXML;
                trvCodeTable.DataSourceID = xmlDsTreeView.ID;
                xmlDsTreeView.DataBind();
                trvCodeTable.DataBind(); 
    }
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
    Timestamp: Fri, 24 Jun 2011 08:19:32 UTC
    Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
    Line: 0
    Char: 0
    Code: 0
    URI: http://localhost:2745/Default.aspx
  6. #6
    Hi,

    Your sample doesn't reproduce the problem (I tested under IE6/7/8/9)
    Also it can be IE bug (not Ext.Net)
    http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/ie8-gets-kb927917-on-pages-being-refreshed-from/5397d04d-3e93-4ed5-b8f4-aa47b6a0abc6
    http://stackoverflow.com/questions/301484/problem-with-html-parser-in-ie
    http://answers.microsoft.com/en-us/i...8-0ce27504dd71
    Please post generated html for the page fires the error

    About updating controls during ajax request. Generaly, Ext.Net can update own controls only. There is Update extension method which you can call for non Ext.Net control but we cannot guarantee that it will work in all cases
    So,
    - call TreeView1.Update();
    - or call Panel1.UpdateContent(); (Panel1 is Ext.Net Panel holds ASP.NET TreeView)

Similar Threads

  1. Ext.NET Treeview Panel with ASP.NET MVC 3 CRUD example
    By richard.tiong in forum 2.x Help
    Replies: 1
    Last Post: Jul 24, 2012, 1:20 PM
  2. Replies: 3
    Last Post: Jan 06, 2011, 4:46 PM
  3. extjs/php user diving into ext.net/asp/c# thread
    By bsmokeman in forum Open Discussions
    Replies: 2
    Last Post: Nov 15, 2010, 7:07 PM
  4. Pairing a treeview with a panel
    By henricook in forum 1.x Help
    Replies: 0
    Last Post: May 12, 2010, 7:14 AM
  5. Problems with ext.panel and asp.Treeview
    By DasPhansom in forum 1.x Help
    Replies: 0
    Last Post: Jan 28, 2009, 11:03 AM

Tags for this Thread

Posting Permissions