Pages

Saturday, 25 February 2012

Bind TreeView Control with an SqlDataSource in ASP.NET

       An exciting control included in the ASP.NET toolbox is the TreeView control.Because the TreeView can display only hierarchical data,it can be bound only to the XmlDataSource and SiteMapDataSource controls.The following code can bind a TreeView control to a SiteMapDataSource control to generate navigation for your page.
      < form id = " form1 " runat = " server " >
               <div>
                         < asp: TreeView ID="TreeView1" Runat="server"
                                    DtaSourceID="SiteMapDataSource1">
                         </asp:TreeView>
                         <asp:SiteMapDataSource ID="SiteMapDataSource1" Runat="server" />
                </div>
      </form>
                       
                                    

No comments:

Post a Comment