Showing posts with label SharePoint 2010 WebParts. Show all posts
Showing posts with label SharePoint 2010 WebParts. Show all posts

Tuesday, August 19, 2014

How to add Web Parts in SharePoint 2010

How to add Web Parts in SharePoint 2010


Web parts are like building blocks for SharePoint 2010. 

They help you add features and functionality to sites. There are many out-of-the-box web parts in SharePoint 2010 that you can add to any page. 

Web Parts are one of the basic building blocks of pages on SharePoint sites. They enable you to customize a SharePoint page to display content or business data from many sources on the same page. You can also use Web Parts to display information from external sources, such as RSS feeds or news sites.

There are more than 15 Web Parts included with SharePoint Foundation 2010. You can also buy Web Parts from other companies, or, if you want to try your hand at writing code, you can develop your own.


Following below steps you will see how to add a standard SharePoint 2010 web part.

  1. Click Page.
  2. Click Edit Page.
  3. Click Add a Web Part.
  4. Browse available web parts by changing the category.
  5. Highlight the web part you want added and click Add.
  6. The Web Part has now been added, Click Stop Editing to exit edit mode.

Tuesday, July 22, 2014

How To Remove Extra Space Around the Web Part In SharePoint 2013

We can remove extra space on webparts in sharepoint 2013 easily as follows:

An extra padding of 20 pixel is included by default in SharePoint 2013 for every webpart.
This may be inconvenient depending on the scenario how you are displaying the content in your Visual WebPart. 

To remove the extra space injected to the Webpart, add the below css in your .ascx file of Visual webapart. This would get rid of the extra space rendered around your webpart

<style type="text/css">
     .ms-webpartPage-root {
         border-spacing: 0px !important;
     }
       .ms-webpartzone-cell {
         margin: 0px !important;
     }
 </style>

Monday, September 23, 2013

What is the WebPartManager sealed class? What is its purpose?

WebPartManager in SharePoint 2010:

The WebPartManager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in WebPartZones. For example, the WebPartManager is responsible for the functionality that is provided when you are working with moving a WebPart from WebPartZone to WebPartZone. It is known as the “the central class of the Web Part Control Set.”

How many WebPartManager controls should be on a page?

In order to have WebParts on a page there has to be just one WebPartManager control to manage all the WebParts on the page.

Monday, August 5, 2013

How to Debug SharePoint 2010 Web Parts from Visual Studio 2010

Debugging SharePoint 2010 Web Parts from Visual Studio 2010 :


For debugging your web part in SharePoint 2010, you should follow below steps as given:
  1. Deploy your Web Part
  2. Add the Web Part to Page
  3. In your code, create a break point.
  4. Go to “Debug” menu, and choose “Attach to Process”.
  5. Under “Attach to:” section, click on “Select …” button.
  6. Check the “Show processes in all sessions” checkbox.
  7. Select all “w3wp.exe” Processes, then click on the “Attach” button.
  8. Run your page that contains the Web Part. You should now hit your break point, and will be able to step through your code.