ASP.NET extraordinary code control

xiaoxiao2021-03-06  90

Crystal Translation ·· Yesky

Adaptability

Affirmation is that usually any new technology will cost some time in the market penetration. Microsoft is beginning to make ASP and IIS platforms through industry verification so that they can be used as a platform other than other web servers.

Such a huge change in its basic framework is difficult to persuade customers or developers to discard their previous methods to change the existing approach. Of course, with time, the problem will always be slowly solved, but in fact, ASP is accepted by the market, and it is an obstacle; even if it is taken, find high quality solutions and technical support. Aspects will come one after another. In fact, ASP.NET is still an alpha technology, but it is so lucky in seeking support.

Existing code

Of course, you have to rewrite all your existing code before converting the system into ASP.NET. Your old code is still working within IIS, but you will still use the traditional ASP framework (this is not a bad thing). Of course, porting a huge web application to ASP.NET is a very painful process, especially if you have a lot of solutions or a COM object.

ASP T code compilation

Let me reiterate again: ASP.NET code is now compiled. Don't be nervous, this is not like you think. You don't need to create a file, in order to re-register the part, you have to stop and then RESTART, now you don't need this, you only You need to write code as usual, still benefit from early bundles, and systematically compile timely.

Optimize and buffer storage. What is this?

Based on the first request of the script, Runtime compiles the code, caches the compile results. Whenever the script is requested, the stored copy can be called out. This result is greatly enhanced. System performance, because after the first request, the code can run from the compiling version faster.

Some people may ask "How do it know when I change?" Microsoft has given this answer .Runtime monitors the source file through the file system. When the initial source file changes, it automatically buffers from the high speed buffer The storage backup is dragged out, so when a request is coming, it (compiled file) will be recompiled. This means that the system will automatically compile the code, and the programmer will no longer need to compile manually.

Caching

For most system developers, they must develop some "caching" to speed the system speed. Whether it is an ASP page output to an HTML file format, the network connection speed is very slow. Or from a slow Internet link to the Recordset status and the Email representation on the roaming form, even a database dynamic driver menu, actually not a complete dynamic driver, you can't waste a lot of time for each of you. When creating a website, in general, a small amount of data will not continue to change, but because they are not true dynamics, don't mean complicate the code, then where are they? So you have to develop some caching

Basic CACHING activities are first selected to store appropriate data. Then you need to place them in the Application level variable in the program. Then, identify the code. Then, you have to decide how long you have to store data, and write the program to clear caching in time. However, if you empty your caching, then the program has the ability to re-recover the data.

Cable system in ASP.NET. Make the entire system more objects than before, making the Caching system can also store objects. Therefore, whenever Caching, you can call it at any time. You can decide to create a variety of types of environments as needed to set up data storage as needed. Through the file system, you can even link a detailed item on a file, so when the file changes, the link item will be stored at the same time.

Not limited thereto, ASP.NET also stores output data. For the ASP. Net script results are a backup, so when others call it, he does not even run, the correct output result is in the transmission. It works primarily based on the query string, if the parameter cannot match the parameters in the store, the page of the record parameter will be rotated to the storage version, and it is a little skill based on the site to determine what needs to be stored, but at least Not needed now.

Faster and easier development

Any development platform will provide you a solid-state environment. In ASP, although the performance of this environment is excellent, it is actually useless. But through the ASP.NET, before you write your first line of code, This environment has been prepared for you. Previous programmers have to do repetitive annoying work in order to design perfect procedures, now this environment has finished.

Object-oriented model

When your code is more running faster than before, you have got a real event model and can control it. In the past, if you want a program to run early, you have to put the program in front of the page, in contrast, put on the rear of the page. This method often does not play a lot, so you have to build your code through a variety of methods to get the desired effect. This "spaghett-code" problem can be corrected by using a large number of events, for example Page_load

Each page level object has its own event model and has a SERVER event that is capable of activating design. A routine similar to Button_Click or ListBox_change, you can make standard form processing, as well as you have a lot of relatively simple daily work. The reading code has also become possible, so that even if a certain program has problems after six months, you can find your previous settings and debug in time.

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

New Post(0)