Sharepoint HTML Editor control in custom webpart

Hi guys,

Today in brief I will like to show how to use SharePoint's HTML Editor control (The one you see in content editor Web Part) as a control in your very own Web Part !



Add a reference to Microsoft.SharePoint.Publishing.dll assembly and continue as follows

Microsoft.SharePoint.Publishing.WebControls.HtmlEditor editor =
new
Microsoft.SharePoint.Publishing.WebControls.HtmlEditor();
editor.AllowHtmlSourceEditing=
"True";
editor.PopupEditorMode=
"True";
editor.UseIntranetMode =
"True";
Tc.Controls.Add(editor);
//editor.Html;

And you are good to go!

2 comments:

  1. how bout it working on SP 2010 where the ribbon concept is there?

    ReplyDelete