asp.net c# tutorials and examples code for beginners

Enable disable theme in asp.net TreeView

How to enable disable theme in TreeView, EnableTheming
TreeViewDisableTheme.aspx
<%@ Page Language="C#" Theme="TreeViewTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to enable disable theme in TreeView, EnableTheming</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Navy">TreeView Example: EnableTheming</h2>
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
        <table>
            <tr>
                <td>
                    <asp:TreeView 
                         ID="TreeView1"
                         runat="server"
                         DataSourceID="SiteMapDataSource1"
                         EnableTheming="true"
                         >
                    </asp:TreeView>
                </td>
                <td>
                    <asp:TreeView 
                         ID="TreeView2"
                         runat="server"
                         DataSourceID="SiteMapDataSource1"
                         EnableTheming="false"
                         >
                    </asp:TreeView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
TreeViewTest.skin
<asp:TreeView 
     runat="server"
     BackColor="Tomato"
     ForeColor="Snow"
     Font-Italic="true"
     Font-Underline="true"
     Width="275"
     >
     <ParentNodeStyle 
        BackColor="Crimson" 
        Font-Bold="true" 
        Font-Italic="false" 
        />
</asp:TreeView>
Web.sitemap
Web.sitemap source code here.

   




Related asp.net example