■ Web.config 파일을 설정해 테마 설정하기

------------------------------------------------------------------------------------------------------------------------

Web.config

 

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

    <system.web>

        <pages theme="Red" />

        <compilation debug="true" targetFramework="4.6" />

        <httpRuntime targetFramework="4.6" />

    </system.web>

</configuration>

 

 

Blue.skin

 

 

<asp:Button runat="server"

    BorderWidth="1px"

    BorderStyle="Dashed"

    BorderColor="Blue"

    BackColor="Yellow"

    ForeColor="Blue" />

 

<asp:Button runat="server"

    SkinID="BlueSkinBold"

    BorderWidth="1px"

    BorderStyle="Dashed"

    BorderColor="Blue"

    BackColor="Yellow"

    ForeColor="Blue"

    Font-Bold="True" />

 

 

Blue.css

 

 

body

{

    color : blue;

}

 

 

Red.skin

 

 

<asp:Button runat="server"

    BorderWidth="1px"

    BorderStyle="Dashed"

    BorderColor="Red"

    BackColor="Yellow"

    ForeColor="Red" />

 

<asp:Button runat="server"

    SkinID="RedSkinBold"

    BorderWidth="1px"

    BorderStyle="Dashed"

    BorderColor="Red"

    BackColor="Yellow"

    ForeColor="Red"

    Font-Bold="True" />

 

 

Red.css

 

 

body

{

    color : red;

}

 

 

BlueSkinPage.aspx

 

 

<%@ Page Language="C#" AutoEventWireup="true"

    Theme="Blue"

    CodeBehind="BlueSkinPage.aspx.cs"

    Inherits="TestProject.BlueSkinPage" %>

<!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>블루 스킨 적용 페이지</title>

    </head>

    <body>

        <form id="form" runat="server">

            <div>

                블루 스킨 적용 페이지

                <hr />

                <asp:Button ID="button1" runat="server"

                    Text="블루 스킨 적용 버튼" />

                <asp:Button ID="button2" runat="server"

                    SkinID="BlueSkinBold"

                    Text="SkinID 적용 버튼" />

            </div>

        </form>

    </body>

</html>

 

 

BlueSkinPage.aspx.cs

 

 

using System;

using System.Web.UI;

 

namespace TestProject

{

    /// <summary>

    /// 블루 스킨 페이지

    /// </summary>

    public partial class BlueSkinPage : 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

    }

}

 

 

RedSkinPage.aspx

 

 

<%@ Page Language="C#" AutoEventWireup="true"

    CodeBehind="RedSkinPage.aspx.cs"

    Inherits="TestProject.RedSkinPage" %>

<!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>레드 스킨 적용 페이지</title>

    </head>

    <body>

        <form id="form" runat="server">

            <div>

                레드 스킨 적용 페이지

                <hr />

                <asp:Button ID="button1" runat="server"

                    Text="레드 스킨 적용 버튼" />

                <asp:Button ID="button2" runat="server"

                    SkinID="RedSkinBold"

                    Text="SkinID 적용 버튼" />

            </div>

        </form>

    </body>

</html>

 

 

RedSkinPage.aspx.cs

 

 

using System;

using System.Web.UI;

 

namespace TestProject

{

    /// <summary>

    /// 레드 스킨 페이지

    /// </summary>

    public partial class RedSkinPage : 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

    }

}

 

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요