Asp. NET page handling problems in advance

Source: Internet
Author: User

1,. NET HTTP request

. NET and ASP's operating mechanism is very different.

The ASP's request and response is that the ASP page is requested and then interpreted line by row. is based on the process. Most of the files are included, you need to introduce the file first.

and. Net, after the page is requested, the first is to load the HTTP Module, which is not the focus of this article. Then load the HTTP Handler. This is not the focus of this article. The two items loaded, All need to be configured in the Webconfig file. This is what you know about URL transfers. After completing these, the page that gives the response starts.

In the job of giving a response page,. NET shows the biggest difference from ASP. NET is an object-oriented language, and is a class based language. No class is difficult to write a meaningful. NET program. If it is written, it is an ASP version.

2,. Basic file structure in net (inheritance relationship)

First of all, you see whether it's 1.1 or 2.0, sites created with vs each aspx file corresponds to a CS file (or VB and other languages). And the CS file in the class and file name, if you meet the keyword will automatically make the class name before adding a ' _ ', for example: _ Default. The CS file created inherits from the System.Web.UI.Page class and can only \ must inherit the class. The reason is that the ASPX file inherits the CS file.

Just take the Default.aspx,default.aspx.cs file.

Default.aspx.cs contains the class _default, inherited characters System.Web.UI.Page

Pass

public class _default:system.web.ui.page
{
private void Page_Load (object sender, System.EventArgs e)
{
//place user code here to initialize page}}
}

You can see it.

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.