"Asp.net4 from Beginner to Mastery" study Note 4

Source: Internet
Author: User

Part 4 Diagnostics and plugins

When I first started looking at this chapter, the real confused. I don't know what I'm talking about. Just read about the HTTP pipeline after. To understand the relevant instructions.

Therefore, for this chapter of the study, we recommend that you first look at HTTP pipeline and then to learn.

The 17th chapter diagnosis and adjustment

This section explains the main debugging methods, but a person feels that the measurement method actually involves a very wide range of content, this chapter is only about the introduction of several major methods.

L START the Trace function on the page and then you can see the call status on the page.

L can also change web.configtrace enable= "true" to achieve trace tracking for the entire system.

L Write detailed tuning information using the Trace.Write Trace.xsd interface

L Visual Studio's single-Step measurement and power-down function.

One of the most important parts is how page faults are handled when a page fault occurs. Can make the system jump to the detailed error page, so that the better to provide user experience.

Detailed method:

L Change the Customeerror field in the Web. config. Then add error filtering rules and pages to jump pages, so that after a specific error occurs, it jumps to the detail page.

L can intercept error in Applicaton_error, then redirect jump page or write log etc.

18th Chapter HttpApplication and HTTP modules

This chapter explains the time. Not to add some basic knowledge, make the understanding of some confusion, here I first add some knowledge, and then go further.

Object:

HttpApplication: A global object that identifies an application that includes those httpmodules and is used to trigger Application_Start class events.

HttpContext: Includes the full request context, usually using the current property

HttpResponse: Packing the response

HttpRequest: Packaging the request

State:

SessionState: Session state

ApplicationState: application-level status

Cachestate: Cache Status

This section is also about the pipeline that IIS handles HTTP requests. Basic processes such as the following:

After IIS obtains the request, it first loads and processes a series of processes, then processes each HttpModule, and then finally handles the corresponding file in HttpHandler.

The essence of HttpModule is in the different stages of application events. Perform different processes, such as validation, calculation, change, and so on.

HttpModule is very easy to write. Just need to integrate the IHttpModule interface to be able, note is to write a class library program, and then the Web. config in which the register, a major HttpModule is finished.

Session interface, can have an interface. This allows the session to be processed in the HttpModule.

19th Chapter HttpHandler Treatment

In fact HttpHandler is to handle the request page, also say a file, for example, ASPX should have corresponding handler to handle.

The implementation is done by inheriting the IHttpHandler interface and then changing the Web. config to configure it, or in IIS.

For simple VisualStudio also provides a ASHX general handler for the file, providing a very easy processing mode. This processing mode is required for customers to visit directly in the browser to be able to.

"Asp.net4 from Beginner to Mastery" study Note 4

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.