Create a Visual Webpart in SharePoint 2013
Also, now you have one Visual WebPart template that can be used to Create both Sandbox and Farm solution. In this post we will look at detailed steps on how to create a Visual WebPart Farm solution and add the wsp to your SharePoint site.
Step 1 - Create a SharePoint 2013 Visual WebPart Project.
Step 2 - Next add the Site Url and select deploy as farm.
Step 3 - The Solution should look like below.
Step 4 - Next add a TextBox in the ascx file and add assign it some text using the Code behind.
Step 5 - Once you add the Textbox save the project and click Start.
Step 6 - Next navigate to the site and verify if the solution is added to the Solutions gallery.You can also add the wsp from your project folder in the Solutions gallery and activate it. See below.
Navigate to Site Settings -> Solutions and upload the wsp. Make sure that the solution is Activated.
Step 7 - Next Add the Visual Webpart to the page. Create a page using "Add Page" in Settings menu and edit it. Next click on the Insert tab and select "Web Part"
Step 8 - Once you add the webpart, save the page and you would see the resulting webpart with a textbox.
0 comments:
Post a Comment