2009/08/18

SharePoint - using the rich text box in a custom user control

Frustration aplenty with this one. Logic dictated that the RichTextField control in SharePoint would have been the one to use...
but no, it's not (as i found out)...so how do you use that shiny nice Rich Text Box control in a custom web part or user control.


simple - so simple i'm sad to say it took me 1 1/2hrs discussing it with some like-minded fellows before we found out what it was (sad i know, but we got there in the end).
Add this to your ascx (if you're using a web user control):

1: <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

and here comes the simple bit..

1:


That's it...not that impressive but that's what you have to do..simple eh :)
Note: this is only available in MOSS 2007.

The article is published by http://msmvps.com/blogs/brianmadsen/archive/2008/03/14/sharepoint-using-the-rich-text-box-in-a-custom-user-control.aspx

No comments: