SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently trying to integrate a rich text editor into my web part.

I've found that I can integrate an InputFormTextBox in my aspx page :

<SharePoint:InputFormTextBox ID="DescriptionTextField" RichText="true" RichTextMode="FullHtml" runat="server" TextMode="MultiLine" Rows="10"></SharePoint:InputFormTextBox>

But this doesn't work :(

The text field is rendered as a simple text field without any buttons to set rich text styles and if i type text into the field, it directly disappears.

I've two JS errors when loading this page :

Message: Invalid source HTML for this operation.
Line: 33
Char: 3
Code: 0
URI: http://localhost/_layouts/1033/form.debug.js?rev=54QM7qflcW2Cscw0gwqGhg%3D%3D

Message: 'selection' is null or not an object
Line: 375
Char: 2
Code: 0
URI: http://localhost/_layouts/1033/form.debug.js?rev=54QM7qflcW2Cscw0gwqGhg%3D%3D

But I don't know how to solve the problem.

Does somebody have an idea ?


share|improve this question

The solution in this blog post shows you how to use the Rich Text control from SharePoint 2007 in a SharePoint 2010 custom web part:

You could also try using the Publishing Rich Text HTML control:

share|improve this answer

Try this :

< asp:TextBox ID="empFirstNameTextBox" runat="server" Width="200px"/ >

< asp:Button ID="submitBtn" runat="server" onclick="submitItems" 
    Text="Submit Security Request" />

       protected void submitItems(object sender, EventArgs e)
                 using (SPSite site = new SPSite(ConnectionString.getCurrentSite()))
                     using (SPWeb web = site.OpenWeb())
                         web.AllowUnsafeUpdates = true;
                         SPList list = web.Lists["EmployeeData"];
                         SPListItem item = list.Items.Add();
                         item["Title"] = empFirstNameTextBox.Text;


        public string getCurrentSite()
            string currentSite = SPContext.Current.Web.Url;
            return currentSite;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.