In the past, I wrote the Aspx. CS code to display a sentence in Aspx. For example, I found 156 records in total.
I wrote this as follows: This. beforehint. Text = string. Format ("{0} records found in total", num );
In general, there is no problem, but once the text information needs to be modified, the Aspx. CS file needs to be modified, and the system needs to be re-compiled. If it's just a place to modify, there's no big problem. It's just a little hard work, but once there are multiple places to change (How many pages a system has, the number of prompts on each page), but the effort is second, not changed, resulting in inconsistent style, it is not good to scare the children.
Therefore, we should extract this part of information from Aspx. CS and place it in the same place. This facilitates modification and is not prone to errors!
For example: 1/*** // <summary>
2 // public prompt Character Set
3 // provide all the prompts, explanations, and instructions in the program
4 /// </Summary>
5 public class commontext
6 {
7 Private Static commontext = NULL;
8
9 protected commontext (){}
10/*** // <summary>
11 // get an instance of commontext
12 // use Singleton Mode
13 /// </Summary>
14 /// <returns> an instance of commontext </returns>
15 public static commontext getcommontext ()
16 {
17 if (null = commontext)
18 {
19 commontext = new commontext ();
20}
21 return commontext;
22}
23/** // <summary>
24 // query the string of the prompt statement
25 /// </Summary>
26 Public String hint
27 {
28 get
29 {
30 return "A total of {0} records are queried ";
31}
32}
33}
This. beforehint. Text = string. Format (commontext. getcommontext (). Hint, num );
In this way, all the prompts, explanations, and instructions can be managed together.
A better job is to make it into a font!