Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

</asp:Label><SharePoint:InputFormTextBox
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!

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

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;

                    item.Update();

                    web.AllowUnsafeUpdates = false;




        }
share|improve this answer
add comment

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

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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

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