ASP.net 2.0 new features

Source: Internet
Author: User

From QuickStart:
Simplified Code behind Model New in 2.0asp.net 2.0 introduces a improved runtime for code-behind pages that simplifies th e connections between the page and code. In this new Code-behind model, the page are declared as a partial class, which enables both the page and code files to be C Ompiled into a single class at runtime. The page code refers to the CodeFile attribute of the <%@ page%> directive, specifying the Class name in the Inherits attribute. This members of the code behind class must is either public or protected (they cannot is private).
C # codebehind Code separation

The advantage of the simplified Code-behind model over previous versions is ' You don't need to maintain separate Arations of server control variables in the Code-behind class. Using Partial classes (New in 2.0) allows the "server control IDs" of the ASPX page to is accessed directly in the Code-behi nd file. This greatly simplifies the maintenance of code-behind pages.
This is really an improvement for development, and Codebehind's declaration of removing the server control will make the code "refreshing" a lot, looking more comfortable. Take a look at the example:
This is really an improvement for development, and Codebehind's declaration of removing the server control will make the code "refreshing" a lot, looking more comfortable. Take a look at the example:
In the page we place a textbox:
Test.aspx
<%@ page language= "C #" codefile= "Test.aspx.cs" inherits= "test_aspx"%>


<title>test asp.net 2.0</title>

<body>
<form runat= "Server" >

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.