In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about the new features of ASP.NET 2.0. the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
The upgrade of ASP.NET technology from version 1. 0 to 1. 1 has not changed much. However, upgrading from ASP.NET 1.x to 2.0 is not an easy task. ASP.NET 2.0 technology adds a large number of convenient and practical new features. ASP.NET 2.0 mainly provides three technical features: control, page framework, service and APIs.
Controls for new features of ASP.NET 2.0
In the ASP.NET 1.x era, developers complained because of the limited number of built-in server controls and narrow functional coverage. In order to eliminate this technical weakness, ASP.NET 2.0 has made a breakthrough. Dozens of new server controls have been added in ASP.NET 2.0. According to the functional characteristics of the control, it can be divided into data controls (including data source controls and data binding controls), login series controls, Web parts, site navigation controls and other controls. These server controls play an important role in improving work efficiency and reducing development costs.
Page framework for new features of ASP.NET 2.0
In terms of page frameworks, 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. Master page feature is widely used in large Web sites, it can replace the frame page function to a certain extent, so as to quickly establish a page with a unified layout and appearance, and effectively reduce the work intensity of maintenance personnel. Themes and skins are a new feature in ASP.NET 2.0 that allows you to style the appearance of one type of server control at once. This appearance can be easily applied to a single page, an entire Web application, or even an entire server. In terms of application compilation, ASP.NET 2.0 provides several alternatives, expanding the range of compilation options that developers can choose according to their specific needs. In addition, ASP.NET 2.0 has made some improvements in terms of localization.
Services and APIs for the new features of ASP.NET 2.0
This section includes new features that account for a large proportion of ASP.NET 2.0, including membership management, role management, user configuration, data caching, configuration and management tools, and so on. Using these functions, we can quickly realize the tasks such as user and role management, personalized user configuration, data caching, application visual configuration and so on. Taking membership and role management functions as an example, it is more tedious and difficult to implement these two functions in the era of ASP.NET 1.x, while in ASP.NET 2.0not only default database tables are provided, but also membership and role management functions can be easily implemented by calling a few simple methods.
1. Add server controls
In the ASP.NET 1.x era, many developers criticized the built-in server controls. The main point is that the number of controls provided by ASP.NET 1.x is too small to meet the growing development needs and to develop applications faster and better. To make up for the deficiency of ASP.NET 1.x, dozens of server controls have been added to the new features of ASP.NET 2.0. According to the control function, it can be divided into site navigation controls, data controls (including data source controls and data binding controls), login series controls, Web parts and other server controls. Skillful use of these server controls is of great significance to provide productivity and reduce development costs.
1. Site navigation control
During the ASP.NET 1.x period, 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. In ASP.NET 2.0, not only the original TreeView is included and extended, but also two other controls are added.
The site navigation control is mainly used to realize the site page navigation function. Site navigation controls include SiteMapPath, Menu, and TreeView controls. According to the site navigation information, the SiteMapPath control can accurately locate the location of the entire Web site where the current page is located. At the same time, the hierarchical representation method is used to display the location information as ordered static text or hyperlinks. In addition, you can also adjust the relevant properties, customize the appearance of location information, and achieve data binding and other functions. The Menu control builds menus similar to Windows applications. The control can not only integrate with a variety of data source controls, but also support custom appearance, event handling and other functions. The TreeView control is primarily used to display a tree structure, which is similar to a tree in Windows Explorer. At the same time, the control also supports data binding, custom appearance and other functions.
2. Data control
ASP.NET 2.0 data controls can be subdivided into two categories: one is data source controls, and the other is data-bound controls. Data source controls include SqlDataSource, AccessDataSource, XmlDataSource, SiteMapDataSource, and ObjectDataSource. These controls mainly realize the functions of connecting different data sources, data retrieval and modification, such as query, sorting, paging, filtering, updating, deletion and insertion, etc. Data binding controls mainly include GridView, DetailsView, FormView and so on. These controls can be used with data source controls to display the acquired data on the page in different forms. Because data source controls and data-bound controls support good visual design-time functionality, when you use Visual Studio 2005 for data access, you don't even need to write any code to accomplish the task.
3. Login series controls
Many Web sites provide user login authentication and related functions. Common features include user login, creation of new users, and so on. In general, the basic methods for implementing these functions are similar, however, due to differences in the level of developers, there may be some unnecessary vulnerabilities and errors. To solve this problem, the new features of ASP.NET 2.0 integrate the implementation related to login authentication into a series of login controls. These controls include: Login, LoginName, LoginView, LoginStatus, PasswordRecovery, ChangePassword and CreateUserWizard. Using these controls, you can easily implement login authentication, create new users, display login status, display login user names, update and reset passwords, and so on. For flexibility, login series controls not only provide a large number of member objects, but also support custom template functionality (some controls support). In addition, the login series controls strengthen security controls. For example, by default, the login series controls work on the HTTP in plain text. If your application is concerned about security, you can use HTTPS with SSL encryption.
The Login control is used to implement user login authentication, and the CreateUserWizard control is used to create new users. Readers may follow the idea before ASP.NET 2.0. they think that to realize the above two applications, it is necessary to add multiple text boxes, buttons and other elements, and design and implement database, data access logic and so on. In fact, using Login and CreateUserWizard controls to achieve the above applications is very simple, so simple that you don't need to write any code or build your own database, you just need to add and set controls.
4. Web components
The Web part is a new feature in ASP.NET 2.0. If you have ever developed and applied SharePoint, you should be familiar with Web parts. The Web part function of ASP.NET 2.0 includes several server controls, such as WebPartManager for managing and controlling WebPart controls, EditorZone and EditorPart series controls for editing WebPart controls, CatalogZone and CatalogPart series controls for catalog management, ConnectionZone controls for WebPart communication, and so on. 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, other server controls have been added to the new features of ASP.NET 2.0. These controls include BulletedList, HiddenField, FileUpload, ImageMap, MultiView (View), and Wizard.
II. Master page
Each site should have a unified style and layout. Different solutions are given in different technological ages. For example, in the ASP technology era, the # include command was used, and in the ASP.NET 1.x period, user controls were mainly used. In the ASP.NET 2.0 technology era, you can use the technical feature of building a page layout framework-master pages.
A master page is a file with a .master extension that has a code content and structure similar to a normal .aspx file. Note that the code includes one or more ContentPlaceHolder controls. When you create a master page, you need to store the common part of the page in the master page, for example, the common header, footer, and so on, while the non-public part of the page uses ContentPlaceHolder controls to occupy space. Although the content page file has the .aspx extension, the content and structure of the code are far from the ordinary .aspx file code, which is divided into two parts: the wharf declares one or more Content controls. The developer needs to bind the master page on the content page on behalf of the wharf and set the non-public part of the page between the Content control tags. At run time, the user cannot request the master page directly, only the content page. At this point, the master page and the content page are merged to form the results page, which contains the running results for the public and non-public parts of the page.
III. Theme and skin
Before you touch themes and skins, you may be used to using cascading style sheets (CSS) to set the appearance and style of elements such as pages and controls. Although CSS is also applicable in ASP.NET 1.x development, it becomes difficult to set up CSS if you encounter some complex controls, such as Calendar, GridView. If the server control can be set up entirely according to the control's own appearance and style properties, rather than limited to the elements specified in CSS, then the whole implementation process will be relatively simple. The themes and skin features in ASP.NET 2.0 can provide such convenience.
A "theme" is a collection of page and control appearance property settings. A theme consists of a set of files that may include skin files, CSS files, pictures, and other resources. These files must be stored in the App_Themes folder. The skin file is the core of the theme. This file has a .skin extension and contains various property settings for various server controls. With the theme feature, you can not only define the appearance of pages and controls, but also quickly and consistently apply the defined appearance to all Web applications, all pages of a single Web application, or a single Web page. In addition, themes can be loaded dynamically according to the needs of the application.
IV. Personalized user configuration
Storing and accessing user configuration data has always been the focus of developers. In the era of ASP.NET 1.x, this function is mainly realized through objects such as Session, Application or database storage. Both methods have their own insurmountable shortcomings. For example, using the former is prone to data loss, while using the latter is more tedious, for example, you need to design your own code to implement the database and access the data. In order to solve the above problems, ASP.NET 2.0 adds personalized user configuration.
The personalized user configuration function is mainly used to store individual user configuration data, which can be simple data types, complex data types, or even custom objects. At the same time, a single user can be either anonymous or registered. By default, all user configuration data is stored in the SQL Server database, and there is no need to create and maintain the database yourself, which is done automatically by ASP.NET 2.0. The personalized user configuration feature also supports a variety of strong types of API accessed from anywhere in the application to facilitate the storage, display, and management of user configuration information. Using the personalized user configuration feature is very simple. First of all, the configuration information name and data type are defined in the Web.config file, and then the strong type API related to the user configuration function is called, for example, Profile realizes the storage, access and management of the user configuration information.
V. membership and role management
The background management of most sites almost includes user members and role management functions, such as creating, modifying, deleting users and roles, setting roles for users, managing users in roles, and so on. When using ASP.NET version 1.x, the main way to achieve these functions is to first design and create member library tables, role library tables, and so on, and then write code to implement specific functions. It may take a lot of time and effort to implement all the functions, and the process is tedious and error-prone. However, this problem can be well solved by using the new membership and role management features of ASP.NET 2.0.
The core of membership and role management function is to realize modular and automatic membership and role management mode by using automatically generated database tables, multiple API, membership and role management providers. Specifically, it includes creating and managing user and role information, managing user and role information in a variety of data sources, verifying user credentials to access applications, supporting the use of Cookie to cache role information, and realizing the integration of role management and membership management.
VI. Configuration and management tools
For quick and easy application configuration and management, two built-in visualization tools are provided in the new ASP.NET 2.0 features: one is the ASP.NET MMC snap-in, and the other is the Web website administration tool.
If you have Internet Information Services (IIS) and .NET Framework 2.0 installed on your computer, you can use the ASP.NET MMC snap-in by opening IIS. With this tool, you can fully set up the connection string, application configuration, custom errors, authorization, authentication, public compilation, page and runtime, globalization and identification, application status, location, and so on for a specified application. The results of all settings are displayed in the application Web.config file. From this perspective, the ASP.NET MMC snap-in is a graphical tool for editing Web.config files.
If you use Visual Studio 2005 to create an ASP.NET 2.0 application, you can call the Web site administration tool. Unlike the ASP.NET MMC management tool, the Web site administration tool is a Web application, not a Windows application. The Web site Administration tool provides settings for the security, application configuration, provider, and so on, of a specified Web application. For example, create administrative user and role information, set SMTP parameters, set various providers, and so on.
These are the new features of ASP.NET 2.0. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.