Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 187885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:54:13+00:00 2026-05-11T15:54:13+00:00

Edit: This is a decade old so very likely not to be relevant to

  • 0

Edit: This is a decade old so very likely not to be relevant to anyone, if google has brought you here I would be sceptical of the content against more modern frameworks!

We have a sharepoint website that has been quite heavily developed with content using the out of the box content editor webpart. This is a bit rubbish when it comes to using any other browser than IE.

We have in mind to update to the free Telerik content editor, however we would like to save ourselves a large amount of copy and pasting, and clicking and selecting to swap the web parts over.

There seems to be no official upgrade path but it seems to me that it must be possible to use the power of code ™ to grab the content of the original webpart, new up a telerik webopart and put the content into the new webpart… then delete the old original web part.

Has anyone done this sort of thing? How is it best to lay out the code and actually run the code that will do the swap (if it is possible). A fresh webpart with a ‘Do Swap’ button on? or something more sophisticated?

I also would need to walk through every page and subsite (and page in subsite) and look at every web part. Is there a best practice way of doing this?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:54:14+00:00Added an answer on May 11, 2026 at 3:54 pm

    I would write a console application for this.

    Open the root Web and iterate through its sub webs. Do the work needed for each page, by opening the WebPartManager.

    Here are some pseudo code to get you started.

    string SourceUrl = 'http://ThisWeb';  using (SPSite sourceSite = new SPSite(SourceURL)) {     using (SPWeb sourceWeb = sourceSite.OpenWeb(SourceURL))     {         IterateSubWebsProd(sourceWeb):     } }  private void IterateSubWebsProd(SPWeb sourceWeb) {     // This is the migration function     DoThingyWithThisWeb(sourceWeb);      foreach (SPWeb subWeb in sourceWeb.Webs)     {       IterateSubWebsProd(subWeb);       subWeb.Dispose();     } }  private void DoThingyWithThisWeb(SPWeb sourceWeb) {     PublishingPage currentPage = null;      string currentPageName = '<something>';     // Find the pages that you want to modify, with a CAML query for example     SPQuery query = new SPQuery();     query.Query = string.Format('' +     '<Where>' +       '<Eq>' +          '<FieldRef Name='FileLeafRef' />' +          '<Value Type='File'>{0}</Value>' +       '</Eq>' +     '</Where>' +     '', currentPageName);        // This codesnippet is from a Publishing web example      PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(sourceWeb);     PublishingPageCollection pageColl = publishingWeb.GetPublishingPages(query);     if (pageColl.Count > 0)     {         currentPage = pageColl[0];     }      using (SPLimitedWebPartManager wpMan = currentPage.ListItem.File.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared))     {         foreach (WebPart wp in wpMan.WebParts)         {             if (wp.GetType().Equals(typeof(Microsoft.SharePoint.WebPartPages.ContentEditorWebPart)))             {                 Microsoft.SharePoint.WebPartPages.ContentEditorWebPart thisWebPart = wp as Microsoft.SharePoint.WebPartPages.ContentEditorWebPart;                  // This is just dummy code, here you will do your content migration                  XmlDocument xmlDoc = new XmlDocument();                 XmlElement xmlElement = xmlDoc.CreateElement('RootElement');                 xmlElement.InnerText = sourceItem[SourceField].ToString();                 thisWebPart.Content = xmlElement;                  wpMan.SaveChanges(thisWebPart);             }         }     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Undoubtedly this question has been asked before, except I completely lack the knowledge to
EDIT: Just to make sure someone is not breaking their head on the problem...
The decode works like this: SELECT DECODE('col1', 'x', 'result1','y','result2') resultFinal FROM table1; It possible
this is my first post on stackoverlow and I couldn't find a solution to
i've been trying to mass-edit a bunch of text files to utf-8 in python
First this IS a Java question so forgive this first C#-related explanation... I've most
Let's say we have this part of code for a UIView subclass: self.myImage =
I found the Bitly API code below on this site. I'm having a hard
HI all, I'm trying to set some validation in my Seam application & I
I need to run .Net code in Sql and I'm trying to decide between

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.