Summary
This article will record how to write the second part of the simplest webpart, that is, configuring webpart, including creating a strong name for the webpart and configuring web. config.
Body
The procedure of each step is recorded below.
1. First, open the project you created, right-click the project name in Solution Explorer, and select Properties from the pop-up menu. The properties box of the Project is displayed, select the signature page in the property box.
On the signature page, sign the Assembly and select new from the select strong name key file drop-down box.
2. In the create strong-name key dialog box that appears, enter the key file by name, for example, key. SNK, and remove the check mark before the password-protected key file.
3. After the key file is created, a key. SNK file is added to the project.
At this point, all the work of the project is complete, and we can compile the project.
4. Configure web. config.
To find the assembly information of the webpart project, we need to use third-party software, such as reflector. Please download the free reflector from the Internet.
Open reflector, find hello. dll in the bin \ debug sub-folder under the project folder, and drag it into reflector. In this way, we can easily find the assembly information (that is, the content after name ).
5. Open the site folder created in this series of articles and find the Web. config file.
6. Open the Web. config file, where <safecontrol> ...... </Safecontrol> to add a configuration line. The content in the Assembly attribute is directly copied from reflector.
7. In the above folder, we can see a sub-folder of _ app_bin. We will copy the compiled hello. DLL to this folder.
Now, all webpart configuration is complete.
In the next article, I will record how to write the third part of the simplest webpart. Thank you for your attention!
"This article is the result of my work. If you have reprinted it, please indicate the source! Thank you for your cooperation ."