Today's iPhone phenomenon has aroused the reflection of more and more domestic entrepreneurs. Why does apple's mobile phone become popular all over the world by relying on it alone.
I remember a saying about the third wave of economy, saying that today's society is a service economy, that is, an economic society that relies on services. Now, I think everyone may have this experience, the argument that software is a service is supported by me. Often, software does not create anything, But why things provide better services and bring about business standardization, convenience, and efficiency.
The next wave of economy will be experience. One person buys something, which is very close to the user experience brought about by this thing. According to my understanding, the iPhone phenomenon may be the desire to purchase the iPhone.
No matter whether you can understand the text above, I think the user experience brought by software will be the constant goal of our software developers.
Can a simple Asp.net skin change improve the user experience? I don't think so. After all, a secure, stable, and reliable system is the most basic, otherwise, no matter how fancy the software is, unreliable software will reduce the software experience, and may even damage the reputation of developers and developers. If you want to improve the quality of software, this topic is too big.Article.
We all know that ASP. net2005 supports skin. In fact, we can also directly use CSS to support skin, but vs2005 simplifies the problem, but the principle is the same, CSS is also used for implementation. So, if you want yourProgramTo better support skin, we recommend that you have a good grasp of CSS.
The following describes the steps supported by the Asp.net skin.
Step 1: Add ASP to a web project. . Net folder, "skin" directory, and then the app_themes directory will be displayed.
Part 2: Add two folders under the app_themes directory, such as "bluesky" and "red", which represent the names of the two skins I want to create.
Part 3: add different resource files in these two directories, such as the required images, CSS files, and Asp.net skin files
Step 4: Add a base class that integrates page, such as the basepage. CS file, and all the later aspx will inherit the basepage. Below is a section of my basepage.Code:
Code
Using System;
Using System. Data;
Using System. configuration;
Using System. Security. Principal;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. webcontrols;
Using System. Web. UI. webcontrols. webparts;
Using System. Web. UI. htmlcontrols;
Using MPC. Core. Dao;
Using MPC. Core. model;
/// <Summary>
/// Basepage Summary
/// </Summary>
Public Partial Class Basepage: system. Web. UI. Page
{
Public Const String Defaultthemename = " Blue " ;
protected void page_preinit ( Object sender, eventargs e)
{< br> string themename = defaultthemename;
If(Page. Request. Cookies [getthemecookiename ()]! = Null)
{
Themename=Page. Request. Cookies [getthemecookiename ()]. value;
}
String Clientscriptblock = " VaR currentthemecookiename = \ "" + Getthemecookiename () + " \ " ; " ;
Page. clientscript. registerclientscriptblock ( This . GetType (), " Currentthemecookiename " , Clientscriptblock, True );
This. Theme=Themename;
}
Protected StringGetthemecookiename ()
{
StringMpccurrenttheme= "Mpccurrenttheme";
StringPath=Page. Request. applicationpath;
Int Startpos = Path. indexof ( " Aspx " );
If (Startpos ! = - 1 )
{
Int Endpos = Path. indexof ( " / " , Startpos );
If (Endpos ! = - 1 )
Mpccurrenttheme = Path. substring (startpos, endpos - Startpos );
}
Return Mpccurrenttheme;
}
}
A brief description of the above Code:
1. basepage must inherit system. Web. UI. Page
2. overwrite the page_preinit method. In this method, we need to obtain the ID of the skin selected by the current user from the cookie, that is, the name of the skin in step 2.
Next, the most important thing is the definition of the skin. For example, I want to use different styles for button controls under different skins. This is defined in my program.
Add a button. Skin file to each skin. The content of this file is as follows:
< ASP: button runat = " Server " Cssclass = " BTN " >
</ ASP: button >
In the above code, I will reference cssclass = "BTN" as my example. In this example, we will define two CSS files under the two directories, for example default.css. The content in the first CSS file is:
Code
. BTN {
Border - Right: # acb3cb 1px solid;
Padding - Right: 10px;
Border - Top: # acb3cb 1px solid;
Padding - Left: 10px;
Font - Size: 12px;
Filter: progid: DXImageTransform. Microsoft. gradient (gradienttype = 0 , Startcolorstr = # Ffffff, endcolorstr = # Dbe0f1 );
Border - Left: # acb3cb 1px solid;
Cursor: hand;
Color: # 04340c;
Padding - Top: 2px;
Border - Bottom: # acb3cb 1px solid
}
The second default. The content of the CSS file is as follows:
Code
. BTN {
Border-Right : # Acb3cb 1px solid ;
Padding-Right : 10px ;
Border-top : # Acb3cb 1px solid ;
Padding-left : 10px ;
Font-size : 12px ;
Filter : Progid: DXImageTransform. Microsoft. gradient (gradienttype = 0, startcolorstr = # ffffff, endcolorstr = # dbe0f1) ;
Border-left : # Acb3cb 1px solid ;
Cursor : Hand ;
Color : # 04340c ;
Padding-top : 2px ;
Border-bottom : # Acb3cb 1px solid
}
The two definitions are different colors.
In this way, I will see different effects when the system is running.
Okay. For more details about how to use skin, please refer to other articles here. I just want to raise this question and give you some help.
Of course, for a development organization, you only need to build a good Asp.net development platform to support the skin, and not all people need to master the content, after all, the core of the project lies in the business process and business methods.