Overview of ASP. net2.0 New Features

Source: Internet
Author: User

The upgrade of ASP. NET technology from version 1.0 to version 1.1 is not significant. However, upgrading from ASP. NET 1.x to 2.0 is not a breeze. ASP. NET 2.0 adds a large number of convenient and practical new features. ASP. NET 2.0 provides three technical features: Controls, page frameworks, services, and APIs.

Widget

In the era of ASP. NET 1.x, developers complained about the limited number of built-in server controls and narrow functional coverage. To eliminate this technical weakness, ASP. NET 2.0 has made breakthrough improvements. In ASP. NET 2.0, dozens of server controls are added. Controls can be divided into data controls (including data source controls and data binding controls), logon controls, Web Components, site navigation controls, and other controls. These server controls play an important role in improving work efficiency and reducing development costs.

Page framework

In terms of page framework, ASP. NET 2.0 has also made significant improvements, mainly reflected in the following four technical features: master pages, themes and skins, compilation mechanisms and localization. The master page feature is widely used in large web sites. It can replace the framework page function to a certain extent, so as to quickly establish a page with a unified layout and appearance, it also effectively reduces the work intensity of maintenance personnel. Topic and skin are a new feature in ASP. NET 2.0. You can use this feature to set a style of server controls at one time. This appearance can be easily applied to a single page and the entire web application.ProgramAnd even the whole server. In terms of application compilation, ASP. NET 2.0 provides several alternative solutions to expand the scope of compilation selection. developers can select based on specific needs. In addition, ASP. NET 2.0 has made some improvements in localization.

Service and APIs

This part includes a large proportion of new features in ASP. NET 2.0, including membership management, role management, user configuration, data caching, configuration and management tools. With these features, you can quickly implement user and role management, personalized user configuration, data cache, and visual configuration of applications. Take the membership and role management function as an example, in ASP. net 1. in the X era, implementing these two functions is cumbersome and difficult. NET 2.0 not only provides default database tables, but also allows you to easily manage members and roles by calling a few simple methods.

1. New server controls

In the ASP. NET 1.x era, many developers criticized the built-in server controls. The main idea is that the number of controls provided by ASP. NET 1.x is too small to meet the increasing development requirements, and applications cannot be developed faster and better. To make up for the shortcomings of ASP. NET 1.x, ASP. NET 2.0 has added dozens of server controls. Controls can be divided into site navigation controls, data controls (including data source controls and data binding controls), logon controls, Web components, and other server controls. Skilled use of these server controls is of great significance for providing work efficiency and reducing development costs.

1. site navigation controls

In ASP. net 1. in the era of X, Microsoft released a set of IE web control controls (non-built-in controls), including a Treeview control that implements a tree structure, which is a typical site navigation control. ASP. NET 2.0 not only contains and extends the original Treeview, but also adds two additional controls.

The site navigation control is mainly used to implement the site page navigation function. The site navigation controls include sitemappath, menu, and Treeview controls. The sitemappath control can accurately locate the entire web site on the current page based on the site navigation information. It also uses hierarchical representation to display the location information as an ordered static text or hyperlink. In addition, you can adjust relevant attributes, customize the appearance of location information, and implement data binding and other functions. The menu control can be used to build menus similar to Windows applications. This control can not only be integrated with multiple data source controls, but also support custom appearance, event processing, and other functions. The Treeview control is mainly used to display the tree structure, which is similar to the tree in Windows Resource Manager. The control also supports data binding, custom appearance, and other functions.

2. Data Control

Data Controls of ASP. NET 2.0 can be divided into two types: data source controls and data binding controls. Data source controls include sqldatasource, accessdatasource, xmldatasource, sitemapdatasource, and objectdatasource. These controls are used to connect different data sources, retrieve and modify data, such as query, sorting, paging, filtering, updating, deleting, and inserting. Data Binding controls mainly include gridview, detailsview, and formview. These controls can work with data source controls to display the acquired data in different forms on the page. Because the data source control and data binding control support good visual design functions, when using Visual Studio 2005 for data access, you do not need to write anyCodeTo complete the task.

3. logon controls

Many Web sites provide user logon verification and related functions. Common functions include user logon and New User Creation. In general, the basic methods for implementing these features are similar. However, due to the Level Difference of developers, unnecessary vulnerabilities and errors may occur. To solve this problem, ASP. NET 2.0 integrates logon verification-related implementations into logon controls. These controls include: Login, loginname, loginview, loginstatus, passwordrecovery, changepassword, and createuserwizard. Using these controls, you can easily perform logon verification, create new users, display logon status, display logon usernames, update and reset passwords, and so on. For flexibility, the logon controls not only provide a large number of member objects, but also support custom templates (some controls support ). In addition, the logon controls also enhance security control. For example, by default, the logon controls work on HTTP in plain text format. If the application is very concerned about security, You Can Use https with SSL encryption.

The login control is used for user logon verification, and the createuserwizard control is used to create a new user. Readers may follow the idea of ASP. NET 2.0 and think that to implement the above two applications, they need to add multiple text boxes, buttons, and other elements, and design and implement the database and data access logic. In fact, it is very simple to use the login and createuserwizard controls to implement the above applications. You only need to add and set controls without writing any code or self-built databases.

4. Web Components

Web parts are new functions in ASP. NET 2.0. If you have developed and applied Sharepoint, you should be familiar with Web components. ASP. NET 2.0 web components include multiple server controls, for example, webpartmanager for webpart control management and control, editorzone and editorpart controls for webpart control editing, catalogzone and catalogpart Control for directory management, and connectionzone Control for webpart communication. They can be used to create highly flexible and personalized Web sites.

5. other server controls

In addition to the four types of controls described above, ASP. NET 2.0 has added other server controls. These controls include bulletedlist, hiddenfield, fileupload, Imagemap, multiview (view), and wizard.

Ii. Master page

Each site should have a uniform style and layout. Different solutions are provided in different technical times. For example, in the ASP technology period, the # include command is used, and the user control is mainly used in the ASP. NET 1. x period. ASP. NET 2.0 technology period, you can use the technical features of building the page layout framework-master page.

A master page is a file with the extension. master. Its code content and structure are similar to that of a common. aspx file. Note that the Code contains one or more contentplaceholder controls. When creating a master page, you need to store the public part of the page in the master page, for example, the page header and the end of the page, while the non-public part of the page uses the contentplaceholder control to implement the placeholder. Although the content page file extension is. aspx, the Code content and structure are far from the code of the common. aspx file. The Code consists of two parts: the code header declares one or more content controls. Developers need to bind the master page in the Content Page code header, and set the Non-Public part of the page content between the content control labels. During running, you cannot directly request the master page, but only the content page. The master page and content page are combined to generate a result page. The result page contains the running results of both the public and non-public parts of the page.

3. Themes and skin

You may have been used to using Cascading Style Sheets (CSS) to set the appearance and style of pages, controls, and other elements before you have touched on themes and skin functions. Although CSS is also applicable in ASP. NET 1.x development, it is difficult to set CSS if complicated controls such as calendar and gridview are encountered. If you can set the server control based on the control's own appearance and style attributes, rather than the elements specified in CSS, the entire implementation process will be relatively simple. The theme and skin functions in ASP. NET 2.0 can provide such convenience.

The so-called "topic" refers to the set of page and control appearance attributes. A topic consists of a group of files, which may include skin files, CSS files, images, and other resources. These files must be stored in the app_themes folder. Skin files are the core content of a topic. The file extension is. Skin, which contains various property settings for various server controls. The theme function not only defines the appearance of pages and controls, but also can be used in all web applications, all pages of a single web application, or a single web page, quickly and consistently apply the defined appearance. In addition, topics can be dynamically loaded based on application needs.

Iv. personalized user configuration

Storing and accessing user configuration data has always been a hot topic for developers. In the ASP. NET 1. x era, this function is implemented mainly through objects such as sessions and applications or database storage methods. Both methods have insurmountable shortcomings. For example, the former is prone to data loss, while the latter is cumbersome. For example, you need to design your own database and data access code. To solve the preceding problems, ASP. NET 2.0 has added the personalized user configuration feature.

The personalized user configuration function is mainly used to store individual user configuration data, which can be a simple data type, a complex data type, or even a custom object. At the same time, a single user can be either an anonymous user or a registered user. By default, all user configuration data is stored in the SQL Server database, and you do not need to create or maintain the database on your own. ASP. NET 2.0 automatically completes these tasks. The personalized user configuration function also allows you to access a variety of strong APIs from any location in the application to facilitate the storage, display, and management of user configuration information. It is very easy to use the personalized user configuration function. First, in the web. the config file defines the configuration information name, data type, and so on, and then calls the strong type API related to the user configuration function, for example, profile allows you to store, access, and manage user configuration information.

V. Member qualifications and role management

In the background management of most sites, almost all functions of user Members and roles are included, such as creating, modifying, and Deleting Users and roles, setting roles for users, and managing users in roles. When using ASP. NET 1.x, the main method to implement these functions is to first design and create a member database table, role database table, and so on, and then write code to implement specific functions. It may take a lot of time and effort to implement all functions, and the process is cumbersome and prone to errors. However, using the new membership and role management functions in ASP. NET 2.0 can solve this problem well.

The core of the membership and role management functions is the use of automatically generated database tables, multiple APIs for managing functions, membership and role management providers, implement modular and automated membership and role management modes. Specifically, this includes creating and managing user and role information, managing user and role information in multiple data sources, verifying user creden for accessing applications, using cookies to cache role information, and implementing role management and integration of membership management and other functions.

Vi. configuration and management tools

To quickly and conveniently implement application configuration and management, ASP. NET 2.0 provides two built-in visualization tools: ASP. net mmc management unit and Web website management tool.

If Internet Information Service (IIS) and. NET Framework 2.0 are installed on your computer, enable IIS to use the ASP. net mmc snap-in. This tool can be used to specify the application connection string, application configuration, custom errors, authorization, authentication, public compilation, page and runtime, globalization and identity, application status, location and other aspects. All settings are displayed in the web. config file of the application. From this perspective, the ASP. Net MMC snap-in is a graphical tool used to edit the Web. config file.

if you use Visual Studio 2005 to create an ASP. NET 2.0 application, you can call the web site management tool. Unlike ASP. net mmc, website management is a Web application, not a Windows application. The website management tool provides various settings for the security, application configuration, and provision of specified web applications. For example, you can create and manage user and role information, set SMTP parameters, and set various providers.

Related Article

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.