This is a migrated thread and some comments may be shown as answers.

[Solved] Programmatically accessing HTML in control

1 Answer 37 Views
RadEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
dai bevan
Top achievements
Rank 1
dai bevan asked on 17 Jan 2006, 03:47 AM

I'm trying to access the HTML within the RAD control.
I've added the RAD Editor control to the default web page and have written a standard aspx page to try and pull the content out from it basically doing the following:

   SPSite site=SPControl.GetContextSite(Context);
   SPWeb web=SPControl.GetContextWeb(Context);
   SPFile file=web.Files["default.aspx"];
   SPWebPartCollection col=file.GetWebPartCollection(Storage.Personal);


   foreach(WebPart wp in col)
   {
    if(wp.GetType() == "Telerik.WebParts.RadEditorWeb")
    { 
        // I can get to here but don't know how to get the HTML
        Response.Write( ????? );
     
    }

This is my first time developing with SharePoint so apologise if this is something simple that I don't know but I can't fingure out how to pull out the HTML content from the webpart. Am I totally on the wrong track ? Any help would be appreciated

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 17 Jan 2006, 01:25 PM
Hi Dai,

The html content of RadEditorWebPart is stored in its Text property. The right way to access it, considering the code snippet you have sent us, would be:

foreach(WebPart wp in col)
   {
    if(wp.GetType() == "Telerik.WebParts.RadEditorWebPart")
    { 
        // I can get to here but don't know how to get the HTML
        RadEditorWebPart editor = (RadEditorWebPart)wp;
        Response.Write(editor.Text);
    }


Regards,
Albert
the telerik team
Tags
RadEditor
Asked by
dai bevan
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or