첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
다운로드

▶ Web.sitemap

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/MainPage.aspx" title="Home"  description="홈">
        <siteMapNode url="~/SubPage1.aspx" title="대분류 1" description="서브 페이지 1">
            <siteMapNode url="~/SubPage2.aspx" title="중분류 1-1" description="서브 페이지 2"/>
            <siteMapNode url="~/SubPage3.aspx" title="중분류 1-2" description="서브 페이지 3"/>
        </siteMapNode>
        <siteMapNode url="~/SubPage4.aspx" title="대분류 2" description="서브 페이지 4" />
        <siteMapNode url="~/SubPage5.aspx" title="대분류 3" description="서브 페이지 5" />
    </siteMapNode>
</siteMap>

 

728x90

 

▶ MainPage.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="TestProject.MainPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>TreeView 클래스 : DataSourceID 속성을 사용해 사이트맵 트리 구조 만들기</title>
    </head>
    <body>
        <form id="form" runat="server">
        <div>
            <asp:SiteMapDataSource ID="siteMapDataSource" runat="server" />
            <asp:TreeView ID="treeView" runat="server"
                ImageSet="XPFileExplorer"
                DataSourceID="siteMapDataSource">
            </asp:TreeView>
        </div>
        </form>
    </body>
</html>

 

300x250

 

▶ MainPage.aspx.cs

using System;
using System.Web.UI;

namespace TestProject
{
    /// <summary>
    /// 메인 페이지
    /// </summary>
    public partial class MainPage : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 페이지 로드시 처리하기 - Page_Load(sender, e)

        /// <summary>
        /// 페이지 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #endregion
    }
}

 

▶ SubPage1.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SubPage1.aspx.cs" Inherits="TestProject.SubPage1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>SiteMapPath 클래스 사용하기</title>
    </head>
    <body>
        <form id="form" runat="server">
            <div>
                <asp:SiteMapPath ID="siteMapPath" runat="server" />
                <hr />
                <h1>대분류 1</h1>
                <a href="SubPage2.aspx">중분류 1-1</a>
                <br />
                <a href="SubPage3.aspx">중분류 1-2</a>
            </div>
        </form>
    </body>
</html>

 

▶ SubPage1.aspx.cs

using System;
using System.Web.UI;

namespace TestProject
{
    /// <summary>
    /// 서브 페이지 1
    /// </summary>
    public partial class SubPage1 : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 페이지 로드시 처리하기 - Page_Load(sender, e)

        /// <summary>
        /// 페이지 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #endregion
    }
}

 

▶ SubPage2.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SubPage2.aspx.cs" Inherits="TestProject.SubPage2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>SiteMapPath 클래스 사용하기</title>
    </head>
    <body>
        <form id="form" runat="server">
            <div>
                <asp:SiteMapPath ID="siteMapPath" runat="server" />
                <hr />
                <h1>중분류 1-1</h1>
            </div>
        </form>
    </body>
</html>

 

▶ SubPage2.aspx.cs

using System;
using System.Web.UI;

namespace TestProject
{
    /// <summary>
    /// 서브 페이지 2
    /// </summary>
    public partial class SubPage2 : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 페이지 로드시 처리하기 - Page_Load(sender, e)

        /// <summary>
        /// 페이지 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #endregion
    }
}

 

▶ SubPage3.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SubPage3.aspx.cs" Inherits="TestProject.SubPage3" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>SiteMapPath 클래스 사용하기</title>
    </head>
    <body>
        <form id="form" runat="server">
            <div>
                <asp:SiteMapPath ID="siteMapPath" runat="server" />
                <hr />
                <h1>중분류 1-2</h1>
            </div>
        </form>
    </body>
</html>

 

▶ SubPage3.aspx.cs

using System;
using System.Web.UI;

namespace TestProject
{
    /// <summary>
    /// 서브 페이지 3
    /// </summary>
    public partial class SubPage3 : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 페이지 로드시 처리하기 - Page_Load(sender, e)

        /// <summary>
        /// 페이지 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #endregion
    }
}

 

▶ SubPage4.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SubPage4.aspx.cs" Inherits="TestProject.SubPage4" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>SiteMapPath 클래스 사용하기</title>
    </head>
    <body>
        <form id="form" runat="server">
            <div>
                <asp:SiteMapPath ID="siteMapPath" runat="server" />
                <hr />
                <h1>대분류 2</h1>
            </div>
        </form>
    </body>
</html>

 

▶ SubPage4.aspx.cs

using System;
using System.Web.UI;

namespace TestProject
{
    /// <summary>
    /// 서브 페이지 4
    /// </summary>
    public partial class SubPage4 : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 페이지 로드시 처리하기 - Page_Load(sender, e)

        /// <summary>
        /// 페이지 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #endregion
    }
}

 

▶ SubPage5.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SubPage5.aspx.cs" Inherits="TestProject.SubPage5" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>SiteMapPath 클래스 사용하기</title>
    </head>
    <body>
        <form id="form" runat="server">
            <div>
                <asp:SiteMapPath ID="siteMapPath" runat="server" />
                <hr />
                <h1>대분류 3</h1>
            </div>
        </form>
    </body>
</html>

 

▶ SubPage5.aspx.cs

using System;
using System.Web.UI;

namespace TestProject
{
    /// <summary>
    /// 서브 페이지 5
    /// </summary>
    public partial class SubPage5 : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 페이지 로드시 처리하기 - Page_Load(sender, e)

        /// <summary>
        /// 페이지 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요