iNoRax.de

ASP.NET 2.0 页面编译方式

转自MSDN

  1. The code-behind file contains a partial class that inherits from a base page class. The base page class can be the Page class, or it can be another class that derives from Page.
  2. The .aspx file contains an Inherits attribute in the @ Page directive that points to the code-behind partial class.
  3. When the page is compiled, ASP.NET generates a partial class based on the .aspx file; this class is a partial class of the code-behind class file. The generated partial class file contains declarations for the page's controls. This partial class enables your code-behind file to be used as part of a complete class without requiring you to declare the controls explicitly.
  4. Finally, ASP.NET generates another class that inherits from the class generated in Step 3. This second generated class contains the code required to build the page. The second generated class and the code-behind class are compiled into an assembly that runs to render output to the browser.

posted on 2007-03-01 20:30  iNoRax.de  阅读(606)  评论(1编辑  收藏  举报

导航