Although. net2005 has been out for a while. However, we use. net2003. when you use. net2003 to develop a web page, you will find a problem. The page capacity is too large. Even if we convert the page into a static page, when a user with a low speed opens your page. This will make the user unable to stand. Those who study your page design will feel very depressed. Of course, we optimize the program. Server optimization is necessary. But we can also take a bath for our pages. Clean up and clean up, and make some small contributions from some small and low-cost aspects.
The Vs. net2003 editor has a lot of automatically generated code. We need to filter. At the same time, some unnecessary redundant tags should also be filtered and we should develop some good page design habits.
1. Use Div + CSS to design pages as much as possible. Do not mark the style on the entire page. This will reduce the page size by at least 10 KB.
2. if not necessary. Set the enableviewstate attribute of some bound controls to false. This occupies too much page capacity. In addition, I am able to know how to paging without viewstate.
3. If the page does not contain buttons or other submit buttons. Remove the form mark at the beginning and end of the page. Generally, the form has a value. These values are not very useful for a display webpage.
4. A tag similar to <input type = text value = ''>. In fact, type = text can be left empty. Although not standardized. However, text is used by default.
5. Try to simplify the comments during page design. Although Annotations do not do anything. However, the client browser still needs to download these strings.
6. It is best to learn some dynamic script technologies. Do not write the DIV directly into the page when it is floating.
7. Control client. Set an ID. You do not have to use attributes such as name. The ID is enough for you to get all the attributes of the space.
8. If not required. The script still encapsulates a script library and uses link to mark the recent connection. At the same time, some scripts can be classified and encapsulated slightly. Do not look like code everywhere. Such as document. getelementbyid...
9 websites are not software. Generally, the storage of page folders should not be too deep. It is recommended that the folder should not exceed 2 levels. If it is too deep. Will appear
<SCRIPT src = "/JS/news/updata/folder/big/classlib. js"> </SCRIPT>. The page capacity is also automatically increased.
10. Although your page sometimes has many parameters. However, you can use the urlrewriting function when placing the link on another page. A URL that is too long may be disturbing to the customer. It is considered to be an insecure connection.
11. Win the dazzling script effect. This is not popular now. Everyone will do this.
12. If it is not an entertaining website that has less flash and other multimedia components, although it looks good, the page size will be large. Opening a client is slow.
13. Do not set the position of the DIV to absolute death. Top: 30px and other helpless labels appear everywhere. If you are a beginner, div + CSS will not control the left and right sides of the div. We recommend that you use float: left or right.
14. Remove some things during page design, such as body ms_positioning = "gridlayout" or meta name = "code_language" content = "C #". The page is much cleaner.
15. At last, I am at a limited level. I can't say it anymore. Please give more advice. However, there is another point to note. . You must use the relative path /to represent the root directory of your website. Too many ../will make the customer's heartbeat faster.