zoukankan      html  css  js  c++  java
  • vs2005建立页面的主题

     

    建立页面的主题

    1.       建立一个新的目录App_Themes 在你的网站

    注意你的目录必须命名为App_Themes

    2.       建立一个子目录在你的App_Themes下去装载你的主题文件。

    例如建立一个BlueTheme目录

    3.       添加文件到你子目录下。例如添加Button.skin

    4.       button.skin里写如下语句

    <asp:Button runat="server"

     BackColor="Red"

     ForeColor="White"

     Font-Name="Arial"

     Font-Size="18px" SkinID="aa" />

     

    <asp:Button runat="server"

     BackColor="Red"

     ForeColor="blue"

     Font-Name="Arial"

     Font-Size="18px" />

    WebSite中应用你的主题

    1 web.config里加入pages元素

     <configuration>

        <system.web>

              <pages theme="BlueTheme" />

        </system.web>

    </configuration>

    注意。这里的theme为你的子目录名称

    2页面中使用

    <asp:Button ID="Button1" runat="server" Text="Button" SkinID=aa/>

    <asp:Button ID="Button2" runat="server" Text="Button" />

    这样你看看你的效果

     How to: Disable ASP.NET Themes
    To disable themes for a page

    <%@ Page EnableTheming="false" %>

    To disable themes for a control

    <asp:Calendar id="Calendar1" runat="server" EnableTheming="false" />

    动态更改主题   
    protected void Page_PreInit(object sender, EventArgs e)
    {

        this.Button2.SkinID = "aa";
        }

  • 相关阅读:
    壶公随感
    消息称微软受谷歌刺激 急于收购雅虎(zz)
    远程注销Windows用户
    "杀人"游戏中的一些规律
    由两点的经纬度估算距离
    我的城市?
    Blog里的一个bug,dudu看能否修正?
    这两天真烦
    发简历,找上海.Net方面软件开发工作
    "上海.NET俱乐部"聚会筹备进展
  • 原文地址:https://www.cnblogs.com/meetweb/p/508618.html
Copyright © 2011-2022 走看看