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.