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 powerful Web component. It provides built-in designer to create your user interface.

This article explains how to create Visual Web Part parts using visual Studio. Prepare, create a list of your own stats, add some columns, fill in some of the data.
Of The data types of the columns are:
1. Open visual Studio and create a new blank SharePoint Project Smallvillevisualwpproject.

Select Deploy as 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. Change code: 4. At this point the file structure should be this:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvy3jhenlnb2xm/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center ">
5. Right-click Playerstatsusercontrol.ascx. Select View Code. 6. Drag the corresponding control in the toolbox, the last code such as the following: 7. The design interface should be this:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvy3jhenlnb2xm/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center ">
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 be this: 11. Click Build--Deploy the solution.

12. On the SharePoint site. Click Site Actions-Edit page-Join the Web Part. 13. Select Playerstats in the custom category and click Join. 14. After saving, the interface should be this:
When you click Load, the list information is loaded.
Enter the corresponding data. Click Add, and then click Load.
Click Clear to empty all filled in text.

Creating Visual Web Part parts using visual Studio

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.