ASP.NET2.0中好东西(theme)介绍

来源:互联网 发布:js动态修改class样式 编辑:程序博客网 时间:2024/06/04 23:23
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
005 深深的吸引了我,心里那个激动啊,迫不及待的学习了关于ASP.NET 2.0中的一些新特性,想小试牛刀,现给大家参考参考,呵呵.
在一个网站的开发过程中,都是靠不同的分工来完成的,如果你是个编码员,是不是希望做美工的人不要动你的代码呢,即使他不是有心的,因为也许他不太懂编码哦.无论是编码的人还是美工的人都不希望在对方的东西中找自己要修改的东西,ASP.ENT2.0中的theme特性可以实现这种分离,不但使结构更清晰,维护也变得方便了.
这种方法很简单,下面简要介绍介绍.
首先按下列步骤建一个 theme及其.skin文件:
1.在自己新建的网站中,右键点击解决方案=>>添加ASP.NET文件夹=>>主题(如 Mytheme).
2.右键Mytheme =>>添加新项=>>选择"外观文件"(取名为Button.skin)
3.现在就可以打开Buttton.skin进行设计了.如
<ASP:button runat="server" SkinID="Blue" font-bold="true" forecolor="blue" />
4.下面就可进行调用刚才的设计了.
在Design 页面拖一个Button控件,切换到代码视图,如下添加红色属性就OK 了.
<%@ Page Language="VB" AutoEventWireup="false" theme ="Mythem" CodeFile="Default.ASPx.vb" Inherits="_Default" %
.......................................
.......................................
<ASP:Button ID="Button1" SkinID ="Blue" runat="server" Text="Button" Width="170px" />
5.调试运行,,Button控件的前景色就应该是蓝色了.
以后你就可以爽快的问做美工的人了:小马,美工做的么样了,如果做好了,你只需做一个简单的theme调用就可以了.
不知道说清楚了没有,呵呵,欢迎批评指正和交流....
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>