Asp. NET low-level architecture exploration into the ASP.net

Source: Internet
Author: User
Tags iis interface what is asp
Asp.net| Architecture ASP. NET is a very powerful platform for building Web applications that provides great flexibility and capacity to build all types of Web applications. The vast majority of people are only familiar with high-level frameworks such as WebForms and webservices-, which are at the highest level in the ASP.net hierarchy. In this article I will discuss the underlying mechanism of asp.net and explain how the request is routed from the Web server to the ASP.net runtime and then how to process the request through the ASP.net pipeline.

For me, knowing the inside of a platform usually brings satisfaction and comfort, and a deeper understanding can help me write better applications. Knowing what tools you can use and how they work together as part of the entire complex framework makes it easier to find the best solutions and, more importantly, to better address them when problems arise. The goal of this article is to understand asp.net from the system level and to help understand how the request is flowing through the ASP.net processing pipeline. Again, we'll see how the core engine and Web requests end there. Most of this information is not something you have to understand in your day-to-day work, but it is very useful in understanding how the ASP.net architecture can route requests to your code, which is usually very high-level.

Anyway, ASP. NET offers more flexibility from a lower level. The HTTP runtime and the request pipeline provide the same capabilities for building WebForms and webservices-they are in fact built on. NET managed code. And all of these same features are available to you, and you can decide whether you need to build a customized platform that is slightly lower than the WebForms level.

WebForms is obviously the easiest way to build most web interfaces, but if you are building a custom content processor (handler), or have special requirements for processing input and output, or you need to create a custom application service interface for another application, Using these lower-level processors (handler) or modules (module) provides better performance and provides more control over actual request processing. While these high-level implementations of WebForms and WebServices provide their capabilities, they also add additional burdens to the request, which can be avoided at a lower level.

  Asp. NET is what

Let's start with a simple definition: What is asp.net? I like this. Define asp.net:

Asp. NET is a complex engine that uses managed code to process Web requests from beginning to end.

It's not just webforms and webservies ...

Asp. NET is a request processing engine. It receives a sent request, passes it to the internal pipeline until the end, and as a developer you can attach some code here to handle the request. This engine is completely separated from the Http/web server. In fact, the HTTP runtime is a component that allows you to get rid of IIS or any other server program and host your own program. For example, you can host the ASP.net runtime in a Windows Form program (see http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp for more detailed information)

The runtime provides a complex but also very elegant mechanism for routing requests in the pipeline. There are a number of related objects, most of which are extensible (through inheritance or event interfaces), in almost all processing processes. So the framework is highly scalable. This mechanism makes it possible to hook up to very low-level interfaces, such as caching, authentication, and authorization. You can even filter the content after preprocessing or processing, or simply route your code or another URL to a request that matches a special tag. There are many different ways to do the same thing, but all of these methods can be implemented simply and directly, while providing the flexibility to get the best performance and the simplicity of development.

The entire ASP.net engine is built entirely on managed code, and all extension functionality is provided through managed code extensions

The entire ASP.net engine is built entirely on managed code, and all extension functionality is provided through managed code extensions. That's right. NET Framework has the best proof of the ability to build complex and efficient frameworks. Asp. NET most impressive is the thoughtful design that makes the framework very easy to use and provides the ability to hook up almost all parts of the request processing.

By asp.net you can work on tasks that previously belonged to the ISAPI extensions and IIS filters-some limitations, but much better than the ASP. ISAPI is a low-level, Win32-style API with very poor interface and difficult to develop complex programs. Because ISAPI is very low-level, it is very fast, but it is very difficult to manage for application-level developers. Therefore, ISAPI is often used to provide bridging interfaces for the transfer of other applications or platforms. But that does not mean that the ISAPI will perish. In fact, ASP. NET on the Microsoft platform is through the ISAPI extension to interact with IIS, this extension is hosted. NET runtime and ASP.net runtime. ISAPI provides the core interface, ASP. NET uses unmanaged ISAPI code to obtain the request from the Web server and send a response back to the client through this interface. ISAPI provides content that can be obtained through common objects such as HttpRequest and HttpResponse, which expose unmanaged data through a well-defined and well accessible interface.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.