I am using a input form text box here is the tag

runat="server" ID="respRichTextBox" ValidationGroup="CreateCase" Rows="10" RichText="true"
TextMode="MultiLine" RichTextMode="FullHtml" AllowHyperlink="true">

I want to save the data entered in the InputFormTextBox(eg the text,images,links) into a sharepoint list field which is multiline type..

Thanks Appreciate your help!


create a multiple lines of text column in SharePoint list,specify the type of text to allow Enhanced rich text (Rich text with pictures, tables, and hyperlinks).

Then you can use the code below to save the content in InputFormTextBox into the SharePoint list field:

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

<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

2.The C# code:

protected void Button1_Click(object sender, EventArgs e)
              SPSite site = SPContext.Current.Site;

                SPWeb web = site.RootWeb;

                    web.AllowUnsafeUpdates = true;
                    SPList list = web.Lists["list"];

                    SPListItem item = list.GetItemById(1);

                    item["InPutFormField"] = inRichTextBox.Text;


                    web.AllowUnsafeUpdates = false;

| improve this answer | |

I never use that control. I use Custom List Form to create custom form for create, or edit an item in a list.

On the SharePoint Designer Insert menu, point to SharePoint Controls, and then click Custom List Form. This is a tutorial to use that control in SharePoint designer.

If you want to use more advance approach for your control, you can use visual webpart for that purpose. In visual web-part you can use standard asp.net control. Here a sample for creating visual webpart

| improve this answer | |

If you are in ApplicationPage you can write some code to get value of your InputFromTextbox value and save it in list you want, but if you are in publishing pagelayouts you can use another control, here is an example:

<PublishingWebControls:RichHtmlField id="Content" FieldName="PublishingPageContent" runat="server"/>

in RichHtmlField control the FieldName attribute represents the multiline field in the Pages library named PublishingPageContent

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.