December 19, 2008

Using SharePoint rich text editor (InputFormTextBox) in your application pages

As the SharePoint rich text editor is located in the Microsoft.SharePoint.WebControls namespace (Microsoft.SharePoint assembly), you have to add the following Register tag on your aspx page.

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
After that, you simply have to add the InputFormTextBoxt control in your page.

<SharePoint:InputFormTextBox Rows="10" MaxLength="1000" id="txtMyRichTextBox" runat="server" RichText="true" RichTextMode="FullHtml" TextMode="MultiLine"  Height="400px" Width="250px"></SharePoint:InputFormTextBox>
The result is the following:



MSDN link: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.inputformtextbox.aspx

No comments: