In the process of technological updates, there are still some people who hold on to things that are already out of breath. There are also some people who have entered a new world but still cannot get rid of the old habits. I have no use of the word "bad habit" because I am also very disgusted with this word.
New technologies should have new technologies. When entering the world, you should correct your past habits and enter a new world completely, throw away the junk of ASP.
The following lists are all wrong practices. Please do not mistakenly think that it is a recommended practice and promote it:
1. Use server side include to introduce common page composition to ASPX.
Under the mechanism, ASCX (web user control) should be implemented. ASCX provides more controllable interfaces. And more importantly, ASCX is a class. A real class can fully control it.
2. Not used
It provides a very rich configuration management interface. It is the core part of an application. But many people are often empty. Or they have never modified it.
3. Use the output message to the front end
Response on the platform and Response on ASP are very different. Although it means the same meaning, its usage is already very different. The content will only be output to the front end of the page. The correct way to output messages to the front end is to use PlaceHolder.
4. Use a series of sessions to manage user connection status
This method is abused in ASP. In the environment, the correct way should be to design a class. Structurally save data and encapsulate access to session or cookies.
5. Use session to verify identity
This is almost a common problem. A set of APIs for user authentication is provided. The type is form verification or windows verification. There is a section on this quick start that explains it very clearly. Most people can rely on assigning values to the session to maintain user authentication status.
6. Use redirect pages
This can be used when necessary. But it cannot be abused. It turns out that abuse of redirection will lead to serious logical confusion. This is what you do when using the page as the program unit. Using the front controller mode will make the user's operation logic centralized]
7. Use too many ASPX pages
The program units in the ASP environment only have *.asp pages, which is not the case. There are also back-end class libraries, ASCX, etc. The business logic should be concentrated in different units, rather than using one ASPX for one operation. More often, ASPX will manage in-page logic as a container for ASCX or custom control. While ASPX reuses ASCX, ASPX is also reused as a unified page composition.
8. Copy code between multiple logical units and modify the corresponding logic
Reuse. Reuse. Reuse. The principle of dealing with such problems is to not have any same or similar processes. If you use the above method, once there are major logical changes, the results will be disastrous.
9. Fear of using DataSet.
Many people are frightened by DataSets. They think that "certainly" affects performance. But they don't even dare to try it out in the first place. They always think that their products must be important and should be "careful" in design. They often use ArrayList or design low-level classes to save collection data. Do difficult data pouring work.
10. Pay too much attention to "performance".
I am particularly dissatisfied with the ViewState mechanism. Or I always try my best to harm others. Instead, I make myself very tired. It may be more civilized if I pay more attention to the database when dealing with ViewState.
11. The application root directory is very messy.
It is a development project. Not a website. Different resource classifications should be placed. For example, all static resources (style sheets, scripts, images) should be organized together. You can even write a set of APIs to manage them. ASPX should be put together. ASCX should be put together. What about ASCX? What about them should be put in another project.
12. The process of writing and accessing the database is tirelessly
This work should be handed over to DataAccess Application Block. You also have to switch the connection yourself, why bother?
13. What you write is the most reliable.
The facts are often the opposite. Pay more attention to using products written by others. If you don’t charge you money, why bother so much to be so proud of yourself?
14. Naming ASPX file names randomly
This is the most painful thing. ASPX file names not only need to be easily identified. They should also follow certain rules. Because behind each ASPX will have a class with the same name. Imagine how uncomfortable it is. In addition, most people don’t know the name space of their projects. It makes people feel like they see an account.
15. Never inherit or derive
Some classes with the same behavior should be derived from public base classes. In fact, our ASPX should have a base class PageBase. Because there are always some public features that need to be abstracted.
16. Zero property
Their class (corresponding to ASPX) only has private method. It does not disclose any of its secrets. Maybe this must be what JAVA's legacy does.
17. Zero ASCX
Needless to say, he hasn't learned it yet
18. Use DreamWeaver to "draw" ASPX
This group of people are artists. Some people are even very intoxicated about how to better "integrate" DreamWeaver and Visual Studio.
19. Only familiar with and should have some familiar library.
20. Zero comments
These are Kuaishou that you know very well. The default comments generated by the IDE are left alone.
21. Zero Event
I don't know anything about "event-driven". I only know how to write the process in Page_Load(). Or double-click a button to write the Xxx_Clock() process. I can't see event and delegate in their programs.
The above is what you think of. If you encounter something that makes you hate deeply, you can also add it. I always think that work is the most direct reflection of character. For programmers, code is the most real portrayal of the soul. It is just a personal opinion.
New technologies should have new technologies. When entering the world, you should correct your past habits and enter a new world completely, throw away the junk of ASP.
The following lists are all wrong practices. Please do not mistakenly think that it is a recommended practice and promote it:
1. Use server side include to introduce common page composition to ASPX.
Under the mechanism, ASCX (web user control) should be implemented. ASCX provides more controllable interfaces. And more importantly, ASCX is a class. A real class can fully control it.
2. Not used
It provides a very rich configuration management interface. It is the core part of an application. But many people are often empty. Or they have never modified it.
3. Use the output message to the front end
Response on the platform and Response on ASP are very different. Although it means the same meaning, its usage is already very different. The content will only be output to the front end of the page. The correct way to output messages to the front end is to use PlaceHolder.
4. Use a series of sessions to manage user connection status
This method is abused in ASP. In the environment, the correct way should be to design a class. Structurally save data and encapsulate access to session or cookies.
5. Use session to verify identity
This is almost a common problem. A set of APIs for user authentication is provided. The type is form verification or windows verification. There is a section on this quick start that explains it very clearly. Most people can rely on assigning values to the session to maintain user authentication status.
6. Use redirect pages
This can be used when necessary. But it cannot be abused. It turns out that abuse of redirection will lead to serious logical confusion. This is what you do when using the page as the program unit. Using the front controller mode will make the user's operation logic centralized]
7. Use too many ASPX pages
The program units in the ASP environment only have *.asp pages, which is not the case. There are also back-end class libraries, ASCX, etc. The business logic should be concentrated in different units, rather than using one ASPX for one operation. More often, ASPX will manage in-page logic as a container for ASCX or custom control. While ASPX reuses ASCX, ASPX is also reused as a unified page composition.
8. Copy code between multiple logical units and modify the corresponding logic
Reuse. Reuse. Reuse. The principle of dealing with such problems is to not have any same or similar processes. If you use the above method, once there are major logical changes, the results will be disastrous.
9. Fear of using DataSet.
Many people are frightened by DataSets. They think that "certainly" affects performance. But they don't even dare to try it out in the first place. They always think that their products must be important and should be "careful" in design. They often use ArrayList or design low-level classes to save collection data. Do difficult data pouring work.
10. Pay too much attention to "performance".
I am particularly dissatisfied with the ViewState mechanism. Or I always try my best to harm others. Instead, I make myself very tired. It may be more civilized if I pay more attention to the database when dealing with ViewState.
11. The application root directory is very messy.
It is a development project. Not a website. Different resource classifications should be placed. For example, all static resources (style sheets, scripts, images) should be organized together. You can even write a set of APIs to manage them. ASPX should be put together. ASCX should be put together. What about ASCX? What about them should be put in another project.
12. The process of writing and accessing the database is tirelessly
This work should be handed over to DataAccess Application Block. You also have to switch the connection yourself, why bother?
13. What you write is the most reliable.
The facts are often the opposite. Pay more attention to using products written by others. If you don’t charge you money, why bother so much to be so proud of yourself?
14. Naming ASPX file names randomly
This is the most painful thing. ASPX file names not only need to be easily identified. They should also follow certain rules. Because behind each ASPX will have a class with the same name. Imagine how uncomfortable it is. In addition, most people don’t know the name space of their projects. It makes people feel like they see an account.
15. Never inherit or derive
Some classes with the same behavior should be derived from public base classes. In fact, our ASPX should have a base class PageBase. Because there are always some public features that need to be abstracted.
16. Zero property
Their class (corresponding to ASPX) only has private method. It does not disclose any of its secrets. Maybe this must be what JAVA's legacy does.
17. Zero ASCX
Needless to say, he hasn't learned it yet
18. Use DreamWeaver to "draw" ASPX
This group of people are artists. Some people are even very intoxicated about how to better "integrate" DreamWeaver and Visual Studio.
19. Only familiar with and should have some familiar library.
20. Zero comments
These are Kuaishou that you know very well. The default comments generated by the IDE are left alone.
21. Zero Event
I don't know anything about "event-driven". I only know how to write the process in Page_Load(). Or double-click a button to write the Xxx_Clock() process. I can't see event and delegate in their programs.
The above is what you think of. If you encounter something that makes you hate deeply, you can also add it. I always think that work is the most direct reflection of character. For programmers, code is the most real portrayal of the soul. It is just a personal opinion.