cannot render TreeView Web Control in IE 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anni V
    New Member
    • Feb 2009
    • 22

    cannot render TreeView Web Control in IE 6.0

    Hi,

    I tried to generate a treeview that loads from the database using a connection string, but the same loads in my browser in cleartext as in the attachment,

    Please can anyone help me out how to render the control in the browser,

    I had downloaded the (iewebcontrols. msi) package & then used the TreeView control in my application.

    The code is below

    Default.aspx
    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <%@ Register Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        Namespace="Microsoft.Web.UI.WebControls" TagPrefix="iewc" %>
    <!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>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
            <iewc:TreeView ID="TreeView1" runat="server"></iewc:TreeView>
         </div>
        </form>
    </body>
    </html>
    Default.aspx.vb
    Code:
    Imports System.Data
    Imports System.Data.SqlClient
    Imports Microsoft.Web.UI.WebControls
    Partial Class _Default
        Inherits System.Web.UI.Page
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim strConn As String = "server=.;database=Northwind;integrated security=true;"
            Dim objConn As New SqlConnection(strConn)
            Dim objDS As New DataSet
            Dim daSuppliers As New SqlDataAdapter("SELECT CompanyName,SupplierID FROM Suppliers", objConn)
            Dim daProducts As New SqlDataAdapter("SELECT ProductName, ProductID, SupplierID FROM Products", objConn)
            daSuppliers.Fill(objDS, "dtSuppliers")
            daProducts.Fill(objDS, "dtProducts")
            objConn.Close()
            objDS.Relations.Add("SuppToProd", _
            objDS.Tables("dtSuppliers").Columns("SupplierID"), _
            objDS.Tables("dtProducts").Columns("SupplierID"))
            Dim nodeSupp, nodeProd As TreeNode
            Dim rowSupp, rowProd As DataRow
            For Each rowSupp In objDS.Tables("dtSuppliers").Rows
                nodeSupp = New TreeNode
                nodeSupp.Text = rowSupp("CompanyName")
                nodeSupp.ID = rowSupp("SupplierID")
                TreeView1.Nodes.Add(nodeSupp)
                For Each rowProd In rowSupp.GetChildRows("SuppToProd")
                    nodeProd = New TreeNode
                    nodeProd.Text = rowProd("ProductName")
                    nodeProd.ID = rowProd("ProductID")
                    nodeSupp.Nodes.Add(nodeProd)
                Next
            Next
        End Sub
    
    End Class
    & the output in the browser only displays the database records retrieved in a straight line of text as a paragraph.(as in the attachment)
    I request you to kindl yhelp me as to why the tree view control is not at all rendering in the IE 6.0 browser.

    Regards

    Ani V
    Attached Files
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Have you considered using the ASP.NET TreeView control instead?

    -Frinny

    Comment

    • Anni V
      New Member
      • Feb 2009
      • 22

      #3
      Thanks buddy it worked,

      But it seems strange that the Tree View Web Control gets rendered somewhat in Safari browser, but not in Internet Explorer.
      Please help me if we can rectify that control for appropriate rendering & functionality.

      But my functionality was achieved through this navigation control

      Thanks a lot

      Ani V

      Comment

      Working...