Geeks With Blogs

News These postings are provided "AS IS" with no warranties, and confers no rights.
Locations of visitors to this page virtusa corp sharepoint virtusa.com shehan peruma
Shehan Peruma

ASP.Net does not provide a rich text box control in its set of web controls. So, if you need to place a rich text box on your SharePoint page you'll have to use a commercial, free or open source text box control (and there are plenty out there). However if you don't want to introduce another dependency, in the form of an external control, you can use SharePoint's built-in rich text box.

If you're creating a page layout that binds to a content types field then its straight forward and you can use RichTextField class. However, if you want to display a textbox that does not interact with a content type then you can use the InputFormTextBox and configure its properties so it render as a rich text box.

Here is an example:

<SharePoint:InputFormTextBox  runat="server" ID="RichTextBox" ValidationGroup="CreateCase" Rows="8" Columns="40" RichText="true" RichTextMode="Compatible" AllowHyperlink="true" TextMode="MultiLine" />

Note: change the RichTextMode value to 'FullHtml' to render more html icons in text box's tool bar.

 

Technorati Tags: ,
Posted on Thursday, August 20, 2009 11:17 AM Customization , Development | Back to top


Comments on this post: Using SharePoint's Rich Text Box in a page

# re: Using SharePoint's Rich Text Box in a page
Requesting Gravatar...
I have tried this on my Web User Control and it does not work, what am I missing
Left by BigRay on Dec 14, 2010 6:04 AM

# re: Using SharePoint's Rich Text Box in a page
Requesting Gravatar...
Hey

Thats a great tip, thank you so much. However is it possible to change the width of the Sharepoint:InputFormTextBox ? I would like it to span the width of my page however both of the width and columns attributes seem to have no effect. Is this a liability with sharepoint rich text fields?

Thanks.
Left by Peter on Aug 10, 2011 12:52 PM

# re: Using SharePoint's Rich Text Box in a page
Requesting Gravatar...
Thanks, this saved my day!
Left by Marnix on Nov 02, 2011 7:23 PM

# re: Using SharePoint's Rich Text Box in a page
Requesting Gravatar...
Is where any way, to add justify alignment and image uploader with file browser to richtextbox?
Left by Sisko on Dec 07, 2011 4:25 PM

# re: Using SharePoint's Rich Text Box in a page
Requesting Gravatar...
Is it possible to enter text and copy picture using SharePoint inputformtextbox, and save to sharepoint, then display in page
Left by Prakash on May 15, 2014 4:13 PM

# re: Using SharePoint's Rich Text Box in a page
Requesting Gravatar...
I tried this InputFormTextBox control but it only works for ie browser, do you know if there is an update or another way how to make it works for all browsers?? Thanks...
Left by Jiovanni on Sep 08, 2014 9:34 PM

Your comment:
 (will show your gravatar)


Copyright © shehan | Powered by: GeeksWithBlogs.net