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";
    }

转载于:https://www.cnblogs.com/meetweb/archive/2006/09/19/508618.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值