Creating Visual Web Part parts using visual Studio

Source: Internet
Author: User
Using visual Studio to create Visual Web Part parts Visual Web Parts is a very powerful Web Part that provides built-in designers to create your user interface. This article explains how to create Visual Web Part parts using visual Studio. Prepare, create a custom list stats, add some columns, populate some of the data.
Among them, the data type of the column is:
1. Open visual Studio and create a new blank SharePoint Project Smallvillevisualwpproject. Choose Deploy as a farm solution. 2. Right-click the project to add a new item-Visual Web Part playerstats. 3. Right-click the project to add a new class Playerstat. Click OK. Modified code: 4. The file structure should look like this at this point:
5. Right-click Playerstatsusercontrol.ascx and select View Code. 6. Drag the corresponding control in the toolbox and the last code is as follows: 7. The design interface should look like this:
8. Double-click each button to create an event. 9. Double-click PlayerStatsUserControl.ascx.cs to see the code behind it. 10. Add the code for the corresponding event. The final code should look like this: 11. Click Build--Deploy the solution. 12. On the SharePoint site, click Site Actions-Edit page-Add Web Part. 13. Select Playerstats in the custom class and click Add. 14. After saving, the interface should look like this:
After clicking Load, the list information is loaded.
Enter the appropriate data, click Add, and then click Load.
Click Clear, and all filled text is emptied.

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.