.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> SharePoint >> Post New QuestionBookmark and Share Subscribe to Forum

Reading the contents of Telerik editor web part which is added in MOSS 2007 web part page

Posted By: Aruna     Posted Date: March 04, 2013    Points:5   Category :SharePoint
Hi,



We have used Telerik RAD Editor web part in MOSS 2007.

i want to read the contents of the telerik(similar to CEWP) web part and add it to the content editor web part as we want to migrate it to sp 2010 environment with out telerik controls.

i have used SPLimitedWebPartManager to access the page and read the title of the web part. i was unable to read its contents as similar to CEWP.

how i could achieve it. My code sample is
using (SPWeb web = site.OpenWeb())
{
SPFile f = web.GetFile("/Pages/Default.aspx");
string cou = f.CheckOutStatus.ToString();
if (cou == "None")
{
f.CheckOut();
}
SPLimitedWebPartManager wpm = f.GetLimitedWebPartManager(PersonalizationScope.Shared);
using (SPWeb wpWeb = wpm.Web)
{
foreach (System.Web.UI.WebControls.WebParts.WebPart wp in wpm.WebParts)
{
if (Equals(wp.GetType().Name, "RadEditorWebPart"))
{
int cnt = wpm.WebParts.Count;
// System.Web.UI.WebControls.WebParts.WebPart webPart = wpm.WebParts["WebPart_6BC2363F-C1C2-4FF7-93C4-6A3BD4A56B90"];
Console.WriteLine(wp.Title);
string webPartTitle = wp.Title;
// wpm.DeleteWebPart(wp);
ContentEditorWebPart cwp = new ContentEditorWebPart();
cwp.Title = webPartTitle;
cwp.ChromeType = PartChromeType.TitleOnly;
wpm.AddWebPart(cwp, "TopZone", 1);
f.CheckIn("CEWP Web part is added");
f.Publish("Added Web Part");
Console.WriteLine("Webpart added");
}

Responses

No response found. Be the first to respond this post
Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend