ButtonExample.aspx
- <%@ Page Language="C#" %>
- <%@ Import Namespace="System.Drawing" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <script runat="server">
- protected void Button1_Click(object sender, System.EventArgs e)
- {
- SiteMapPath1.BackColor = Color.Cornsilk;
- SiteMapPath1.ForeColor = Color.Crimson;
- SiteMapPath1.Font.Size = FontUnit.Large;
- SiteMapPath1.Font.Italic = true;
- SiteMapPath1.PathSeparator = " / ";
- SiteMapPath1.NodeStyle.ForeColor = Color.PaleVioletRed;
- SiteMapPath1.Font.Bold = true;
- SiteMapPath1.RootNodeStyle.Font.Size = FontUnit.XLarge;
- }
- </script>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>How to set, change SiteMapPath style programmatically</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <h2 style="color:Navy">SiteMapPath Example: Style</h2>
- <asp:SiteMapPath
- ID="SiteMapPath1"
- runat="server"
- >
- </asp:SiteMapPath>
- <br /><br /><br /><br />
- <asp:Button
- ID="Button1"
- runat="server"
- ForeColor="SteelBlue"
- Text="Change SiteMapPath Style"
- Height="45"
- OnClick="Button1_Click"
- Font-Bold="true"
- />
- </div>
- </form>
- </body>
- </html>
Web.sitemap
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="Home Page">
<siteMapNode url="StandardToolBox.aspx" title="StandardToolBox" description="StandardToolBox Controls">
<siteMapNode url="AdRotatorExample.aspx" title="AdRotator" description="AdRotator Example" />
<siteMapNode url="BulletedListExample.aspx" title="BulletedList" description="BuulletedList Example" />
<siteMapNode url="ButtonExample.aspx" title="Button" description="Button Example" />
<siteMapNode url="CalendarExample.aspx" title="Calendar" description="Calendar Example" />
</siteMapNode>
<siteMapNode url="DataToolBox.aspx" title="DataToolBox" description="DataToolBox controls">
<siteMapNode url="ListViewExample.aspx" title="ListView" description="ListView Example" />
<siteMapNode url="GridViewExample.aspx" title="GridView" description="GridView Example" />
</siteMapNode>
<siteMapNode url="NavigationToolbox.aspx" title="Navigation Toolbox" description="NavigationToolbox controls">
<siteMapNode url="MenuExample.aspx" title="Menu" description="Menu Example" />
<siteMapNode url="SiteMapPathExample.aspx" title="SiteMapPath" description="SiteMapPath Example" />
<siteMapNode url="TreeViewExample.aspx" title="TreeView" description="TreeView Example" />
</siteMapNode>
</siteMapNode>
</siteMap>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="Home Page">
<siteMapNode url="StandardToolBox.aspx" title="StandardToolBox" description="StandardToolBox Controls">
<siteMapNode url="AdRotatorExample.aspx" title="AdRotator" description="AdRotator Example" />
<siteMapNode url="BulletedListExample.aspx" title="BulletedList" description="BuulletedList Example" />
<siteMapNode url="ButtonExample.aspx" title="Button" description="Button Example" />
<siteMapNode url="CalendarExample.aspx" title="Calendar" description="Calendar Example" />
</siteMapNode>
<siteMapNode url="DataToolBox.aspx" title="DataToolBox" description="DataToolBox controls">
<siteMapNode url="ListViewExample.aspx" title="ListView" description="ListView Example" />
<siteMapNode url="GridViewExample.aspx" title="GridView" description="GridView Example" />
</siteMapNode>
<siteMapNode url="NavigationToolbox.aspx" title="Navigation Toolbox" description="NavigationToolbox controls">
<siteMapNode url="MenuExample.aspx" title="Menu" description="Menu Example" />
<siteMapNode url="SiteMapPathExample.aspx" title="SiteMapPath" description="SiteMapPath Example" />
<siteMapNode url="TreeViewExample.aspx" title="TreeView" description="TreeView Example" />
</siteMapNode>
</siteMapNode>
</siteMap>
No comments:
Post a Comment