What Is Webpart ?
Webparts are one of the most commonly used in SharePoint. Webparts framework was first introduced in ASP.NET 2.0. Webparts that are inherited from Webpart class are fully supported in SharePoint and are useful in many ways.
Webparts are one of the most commonly used in SharePoint. Webparts framework was first introduced in ASP.NET 2.0. Webparts that are inherited from Webpart class are fully supported in SharePoint and are useful in many ways.
A Web Part, also called a Web Widget, is an ASP.NET server control which is added to a Web Part Zone on Web Part Pages by users at run time.
From an End User perspective it’s a single unit of a re-usable component that can be added to a SharePoint page to perform a specific task.
Types of Webparts
Types of Webparts
We can create a webpart in three ways.
- Using Visual Studio
- Uisng SharePoint Designer
- Using Out Of Box
Using Visual Studio
Open Visual Studio -> Create a new Empty SharePoint 2013 Project -> Choose the Solution, where you want to deploy

Right Click The Project , then Select “Add” and click the “New Item” link in the context menu ->


Click on New Item then In the Installed Templates, select “Visual Web Part”

Once you click Add, then project will be created inside Visual Studio.


Once you click Add, then project will be created inside Visual Studio.

The Webpart file automatically created these many files inside project folder. If you want to change the scope of the feature then we are able to change the feature inside Feature.feature file.

Once you set the Feature , we can open .ascx file to add the control and design the page as per the requirement.
- <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
- <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
- <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
- <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
- <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
- <%@ Import Namespace="Microsoft.SharePoint" %>
- <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
- <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1.ascx.cs" Inherits="First_VisualWebPart.VisualWebPart1.VisualWebPart1" %>
- <table>
- <tr>
- <td>
- <asp:DropDownList ID="ddltest" runat="server"> </asp:DropDownList>
- </td>
- <td> </td>
- <td>
- <asp:Button ID="btngetData" runat="server" Text="Test Webpart" OnClick="btngetData" /> </td>
- </tr>
- </table> // This is just a sample script. Paste your real code (javascript or HTML) here. if ('this_is'==/an_example/){of_beautifier();}else{var a=b?(c%d):e[f];}







Join the conversation! Your thoughts help the community grow.