Introduction to good stuff (theme) in ASP.NET 2.0
Author:Eve Cole
Update Time:2009-06-30 17:00:05
Recently, Visual Studio 2005 has deeply attracted me. I am so excited that I can’t wait to learn some new features in ASP.NET 2.0. I want to try it out, so here it is for your reference, haha.
In the development process of a website, it is all accomplished by different divisions of labor. If you are a coder, do you hope that the artist will not touch your code, even if he does not mean it, because maybe he does not understand it well? Coding. Neither the coder nor the artist wants to find something they want to modify in the other party's stuff. The Theme feature in ASP.ENT2.0 can achieve this separation, which not only makes the structure clearer, but also easier to maintain. It has become convenient.
This method is very simple and will be briefly introduced below.
First, follow the following steps to create a Theme and its .skin file:
1. In your newly created website, right-click the solution =>> Add ASP.NET folder =>> Theme (such as Mytheme).
2. Right-click Mytheme =>>Add new item =>>Select "Skin File" (named Button.skin)
3. Now you can open Buttton.skin for design. For example
<asp:button runat="server" SkinID="Blue" font-bold="true" forecolor="blue" />
4. Now you can call the design just now.
Drag a Button control on the Design page, switch to the code view, and add the red attribute as follows.
<%@ 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. After debugging and running, the foreground color of the Button control should be blue.
In the future, you can easily ask the artist: Xiaoma, how is the artist doing? If it is done, you only need to make a simple Theme call.
I don’t know if I made it clear, haha, criticism, corrections and exchanges are welcome....