A large part of the ASP.NET programmers are migrated by ASP. This is a natural transition. As everyone is a new technology compared to ASP. They are just similar to the name. Or for technology Some similar APIs are specially reserved. But this brings problems. Many people only think that ASP.NET is an upgrade of ASP, or .NET version. Where know .Net is a new application platform. If The ASP is as a shell, then ASP.NET will be the ocean.
But too many people didn't realize this. Or don't read it. Many people continue to write ASP.NET applications in the way they are used to. Even the power of the practice is huge, but change must have pain, not completely eradicate some The right practice is difficult to get true knowledge.
The following is the wrong practice, please don't misunderstand the recommendation of the recommendation:
1. Use Server Side Include to introduce a common page composition to ASPX.
Under the ASP.NET mechanism, ASCX (Web User Control) should be used to implement a unified page composition. ASCX provides more controllable interfaces. And more importantly, ASCX is a class. A real class. It can be fully controlled. Give ASPX to use Server Side Include will bring a lot of problems.
2. Do not use Web.config
Web.config provides a very rich configuration management interface. It is the most core part of an application. But many people's web.config is often empty. Or never modified.
3. Use the response.write to output a message forward
The response and ASP's response under the ASP.NET platform is very different. Although the same meaning is expressed, it has been largely different. The content of Response.Write will only output the front end of the page. The correct output message is output. The method is to use PlaceHolder.
4. Use a series of session to manage user connection status
This approach is abused in the ASP. Excessive session will make the application very difficult to manage. In the ASP.NET environment, the correct approach should be designed. Structured saves data. Will be session or Cookie's access package.
5. Use session to verify 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 very clear. Can most people still rely on the session assignment To keep the user authentication status.
6. Redirect the page with Response.Redirect
This can be used when necessary. But it is not abused. It is fact that abuse redirect will lead to logical serious confusion. This is the way to use the Front Controller mode. Using the Front Controller mode will enable the user's operational logic stand up]
7. Use too many ASPX pages
The program unit in the ASP environment is only * .asp page, ASP.NET is not like this, there is a rear end class library, ASCX, and more. The business logic should be concentrated in different units, not one action to use an ASPX. . More time ASPX will be used as an ASCX or Custom Control's container to manage page logic. At the same time as ASPX reusing ASCX, ASPX is also a unified page archive reuse.
8. Copy the code between multiple logical units and modify the corresponding logic
Reuse. Reuse. Reuse. The principle of dealing with such issues does not have any same or similar processes. If you use the above method, once a major logic change occurs, the result will be disastrous.
9. I am afraid to use DataSet.
Many people were frightened by Dataset. Think "affirmative" affects performance. But even the initial attempts don't dare. They always think that their products are certain, "cautious" should be designed. They often use arraylist or design low-level classes. Save collection data. Careful data pour it into work.
10. Too much attention to "Performance".
The mechanism for ASP.NET ViewState is particularly dissatisfied. Or always dig your mind persecuted people. Inverted yourself very tired. If you pay more attention to viewstate, you will pay more attention to a few databases.
11. The application root directory is very chaotic.
ASP.NET is a development project. Not site. Different resource classifications should be placed. For example, all static resources (style sheets, scripts, images) are organized together. You can even write a set of APIs to manage them. ASPX should be put together ASCX should be put together together. *. CS? Should put them in another project. 12. Process of writing accessing the database without tireless
This should be handed over to the DataAccess Application Block. You still have to switch Connection, why bother.
13. The things you write are most close.
The fact is often just the opposite. Pay more attention to the use of people to write products. Don't charge you money, why do you like to love the face?
14. Name the ASPX file 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 will have a class of the same name, imagine, more difficult. In addition, most people don't know how to manage themselves. The Name Space of the project seems to see a book.
15. Never be inherited or derived
Some classes with the same behavior should be derived from the public base class. In the actual sense, our ASPX should have a base class PageBase. Because there are always some public features need to be abstract.
16. Zero Property
There is only private method in their class (corresponding to AspX). No secrets of your own. It can be this legacy of Java's legacy.
17. Zero ASCX
Needless to say, he still didn't learn asp.net
18. Use Dreamweaver "painting" ASPX
This group of people is a beauty. There are even some people discuss how to better "integrate" Dreamweaver and Visual Studio discussing very intoxicated.
19. Just familiar with System.Web.ui.WebControl and System.Data.sqlclient
There should be some class libraries worth familiar with.
20. Zero Note
These are all very clear, and the default comment generated by an IDE is there.
21. Zero event
I don't know anything about "Event Driver". I only know in page_load (). Or double click a button to write xxx_clock () procedure. Event and delegate are not seen in their programs.
22. Research on "Pedfaction Value"
Typical approach is to summarize several page "methods". For example, using query string, use SESSION, use form post, etc. I don't know that the Form under ASP.NET is the default POST to this page. We may never need to use the Request.form ["Name"] to get the value of the form. Although the frame holds such an interface.
In fact, in the ASP.NET environment, the regular type value is rarely transmitted between the module or the program unit. Under the event driver, we generally do not let a page take the initiative to get the "pass value" in the imagination, these The process is generally packaged in an event or state. Therefore, there is no problem between the page or window or the frame. In general, we will have a dedicated deep mechanism to hide this process. Mastering this principle: in business Avoid contact with excessive systems during the process.
What else is to be written? If you encounter something that makes you deep, you can add it.
Just a personal opinion.