How to Add Web Parts to the Page Programmatically?

Requirement is to add OOTB and Custom web parts to a web part page programmatically via features. I’m sharing the code snippets: To Add Out Of The Box Web Parts: (E.g. Content Query Web Part, Content Editor, Page Viewer Web Part, etc): Add Page Viewer web part: Programmatically add ListView webpart from:…

Read more

Remove Faulty Web Part with Web Part Page Maintenance Mode

There was a custom web part deployed in our environment. For some reasons, web part encountered some issue and made the pages crashed!. Ideally, The developer should have handled the error in web part to avoid page crash! but it didn’t happen! how to remove faulty web part in SharePoint 2007 or…

Read more

Display PDF Files in Content Editor Web Part

We can display PDF files inside content editor web part. Here is how:add a Content Editor web part to the page and place the object tag as below in HTML Source of the content editor web part. Using Object Tag to display PDF document in CEWP: <object width=”400″ height=”500″ type=”application/pdf” data=”http://sp10.Crescent.com//MCM/Documents/Pre-Reads.pdf?#zoom=75&scrollbar=1&toolbar=1&navpanes=1″ id=”pdf_content”>…

Read more

How to Integrate Syntaxhighlighter with SharePoint?

Needless to say, the format and style of our code play a vital part when writing technical blogs. Among the other code formatting plugins, I personally like SyntaxHighlighter as it is very easy to configure and use while keeping the code readable and easy to copy. In this article I’m sharing my…

Read more

Workflows, Manage Permissions options missing in XSLT dataview ECB Menu

When we convert the SharePoint List view to XSLT dataview, “Workflows” will be missing in context Menus. Not only Workflows, Manage Permissions, Edit Document, and some more options will be missing. The only workaround so far I know: Add a new column to the dataview, say the title for the column as…

Read more

Copy Webpart Pages between SharePoint Site Collections

Had a requirement to copy web part pages from one site collection to other. These options failed, I got the page with out any web parts placed: Explorer view copy paste Download a copy and upload SharePoint Designer copy-paste The worked trick is: Using SharePoint Designer – “New from Existing Page”. Steps…

Read more

How to Embed and Integrate YouTube Videos in SharePoint Content Editor Web Part?

It’s a frequently asked question to me, guys asking: “I need to add YouTube videos in my SharePoint site”. In fact, it is very simple to implement. So I’m going to walk-through on how to embed YouTube videos in SharePoint, just using the content editor web part. 1.   Go to YouTube.com and…

Read more

Remove a Web Part Programmatically using PowerShell

We have had bunch of SharePoint 2007 site collections and recently upgraded them to SharePoint 2010. After the upgrade for some reasons, we wanted to delete a particular web part (Tip of the day web part) from the home page of All migrated sites’ default.aspx page of the many sites. I get…

Read more