The Visual Web Parts widget is a very powerful Web Part that provides a built-in designer to create your user interface. This article explains how to create a Visual Web Part widget using Visual Studio.
Prepare, create a custom list stats, add some columns, and fill in some of the data.
Where the data type of the column is:
1. Open visual Studio and create a new blank SharePoint Project Smallvillevisualwpproject. Select Deployment as a farm solution.
2. Right-click the item to add a new item--Visual Web Part playerstats.
3. Right-click the item to add a new class Playerstat. Click OK. To modify the code:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Namespace Smallvillevisualwpproject
{
class Playerstat
{public
string PlayerName {get; set;}
public string gamesplayed {get; set;}
public string Numofgoals {get; set;}
public string Numofassists {get; set;}
public string Numofpim {get; set;}
public string Playeravg {get; set;}}}
4. The file structure should now be like this: