Asp.net 2.0-Web Parts Study Notes

Source: Internet
Author: User

Learning. net has been involved in the development of several project projects of the teacher for a while, but has little access to the uidesign of Asp.net. Although VS2005 has been launched for almost two years, however, some of the new controls in VS2005 have not been used yet. Recently, when I am idle, I just want to learn how to use them. I downloaded some WebCast from the MS website and practiced it.

The description of Web Parts in MSDN: "ASP. NET Web Parts is an integrated set of controls used to create websites so that end users can directly modify the content, appearance, and behavior of webpages from their browsers. These modifications can be applied to all users on the website or individual users. When you modify pages and controls, you can save these settings so that the user's personal preferences can be preserved across future browser sessions. This feature is called personalized settings. These Web part functions mean that developers can enable end users to dynamically customize Web applications without the intervention of developers or administrators ." The following is my preliminary experience of using Web Parts:

1. WebPart "An error occurred while establishing a connection with the server" solution:
WebPart customization requires database support. After the control location is changed, it must be recorded in the database. By default, it is connected to SQL Server 2005 Express. However, after installing VS2005 and SQL Server 2005 Enterprise Edition, delete the Express version, as shown in the following figure:

The general meaning is "An error occurred while establishing a connection with the server. When you connect to SQL Server 2005, the default setting does not allow remote connection to SQL Server may cause this failure. (Provider: SQL network interface, error: 26-An error occurred while locating the specified server/instance )". Solution:
(1) Run aspnet_regsql.exe in the vs2005command line, create an aspnetdb database in SQL Server 2005 according to the "Asp.net SQL Server Setup Wizard" Wizard (you can also use this method to create an aspnetdb database in other SQL Server versions );
(2) modify the connectionStrings configuration section in the web. config file as follows:

<ConnectionStrings>
<Remove name = "LocalSqlServer"/>
<Add name = "LocalSqlServer" connectionString = "Data Source = Database Service name; Initial Catalog = aspnetdb; Persist Security Info = True; UID = sa; password = Database password "providerName =" System. data. sqlClient "/>
</ConnectionStrings>

 

2. Five display modes of the page:

3. DeclarativeCatalogePart, PageCatalogPart, and ImportCatalogPart must be placed in the CatalogZone control to use the CatalogDisplayMode of WebPartManager:

4. The EditDisplayMode of WebPartManager can be implemented only when four controls are put into EditorZone: AppearanceEditorPart, BehaviorEditorPart, LayoutEditorPart, and PropertyGridEditorPart:

5. These controls in WebParts must be used together to provide powerful functions.

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.