A paragraph of a big morning

xiaoxiao2021-03-06  66

In the process of technology updates, there are still things that have been in the abundance. There are also some people enter the new world, but they still can't get out of the old habits. I didn't use the word "bad habits". Because I am also very disgusted on this word.

New technologies should have new technologies. In the world of ASP.NET, they should correct past habits, new into new worlds, and throw away ASP.

The following is the wrong practice, please don't misunderstand the recommendation of the recommendation:

1. Using Server Side Include to introduce a common page composition. Under the ASP.NET mechanism, ASCX (Web User Control) should be used. ASCX provides more controllable interfaces. And more importantly, ASCX is A class. A real class. You can fully control it.

2. Do not use Web.ConfigWeb.config to provide a very rich configuration management interface. It is the core part of an application. But many people's web.config is often empty. Or never modified.

3. With Response.Write's response and ASP's response under the ASP.NET platform, it is very different. Although it is the same meaning, it has been largely different. The content of Response.Write will only output to the page. The front end. The correct way to output messages forward is to use PlaceHolder.

4. Using a series of session managed users Connection status This method is abused in ASP. In the ASP.NET environment, the correct approach should be designed. Structured saves data. Send the session or cookie access package .

5. Use the session to verify the identity. This is almost a common problem. ASP.NET provides a set of APIs for user authentication. Types are Forms verification or Windows verification. This quick start has a section that is clear. You can most People still rely on the SESSION assignment to maintain the user authentication status.

6. Redirect the page using the response.redirect to be used when necessary. But not abuse. It is fact that abuse redirect will result in logical serious confusion. This is the practice of the page as the program unit. Using Front The Controller mode will enable the user's operational logic.

7. Using too many ASPX Page ASP environments only * .asp page, ASP.NET is not like this, there is also a backend library, ASCX, and more. The business logic should be concentrated in different units, not You should use an action using an ASPX. More time ASPX will be used as an ASCX or CUSTOM Control container to manage page logic. AspX reuses ASCX, ASPX is also a unified page archive reuse.

8. Copy the code between multiple logic units and modify the corresponding logic reuse. Reuse. Reuse. The principle of processing such issues does not have any same or similar processes. If you use the above method, once a major logic change, The result will be catastrophic.

9. I am afraid to use Dataset. Many people are frightened by Dataset. Think "affirmation" affects performance. But even the initial attempts do not dare. They always think that their products are significant, "cautious" should be designed. They often use arraylist Or design the low class to save collection data. Careful data is poured into work.

10. Too much attention to "Performance". It is particularly dissatisfied with the mechanism for ASP.NET ViewState. Or always dig your heart. It is more tired to put yourself. If you pay more attention to the viewstate, you will be more Civilization.

11. Application root directory is very chaotic .aSP.NET is a development project. Not a website. Different resource classifications should be placed. For example, all static resources (style sheets, scripts, images) are organized together. Even write a set of APIs To manage them. AspX should be put together. ASCX should be put together. *. CS? What about placing them in another Project.

12. The process of not annoying writing access databases should hand over this work to the DataAccess Application Block. You have to switch the connection, why.

13. The things you wrote are most close. The fact is often just the opposite. Pay more attention to the use of people to write products. Don't receive your money, why do you like to love the face?

14. This is the most painful name. This is the most painful. The ASPX file name is not only easy to identify. It should also follow a certain rule. Because Behind has a class of the same name, imagine, how difficult it is. Some people don't know the Name Space to manage their own projects. It seems that it seems to see this account. 15. Never be inherited or derived some kinds of class with the same behavior, should be derived from the public base class. In practice, we ASPX should have a base class PageBase. Because there are always some public features that need to be abstract.

16. Zero Property only private method in their class (corresponding) in ASPX. Do not open any of your secrets. It can be this legacy of Java.

17. Zero ASCX does not have to say, he has not learned asp.net

18. This batch of people using Dreamweaver "ASPX is a beauty. There are even some people discuss how to better" integrate "Dreamweaver and Visual Studio are very intoxicated.

19. Just familiar with System.Web.ui.WebControl and System.Data.sqlclient should have some class libraries worthy of familiarity.

20. Zero Note These are all very clear in their hearts. The default comment generated by an IDE is there regardless.

21. Zero event does not know about "event driver". I only know in page_load (). Or double click a button to write the xxx_clock () process. You can't see Event and Delegate in their programs.

What else is to be written? If you encounter something that makes you deep, you can add it.

I have always thought that the work is the most direct reflection of character. For programmers, the code is the most authentic mind. Just personal opinion.

转载请注明原文地址:https://www.9cbs.com/read-106112.html

New Post(0)