InputFormTextBox Control
When developing application pages or web parts, you can use this control to place a textbox on the user interface. You can set properties so that the text box renders as single line, multi line or password. You can also choose for a normal text box or a rich text box.
The figure contains an example of a single-line InputFormTextBox and an example of a muti-line rich text box:

<spuc:InputFormTextBox runat="server" ID="InputFormTextBox3" Width="60%" />
Add the required directive at the top of the page:
<%@ Register TagPrefix="spuc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
You can also create this type of control completely in code:
InputFormTextBox textbox = new InputFormTextBox(); textbox.ID = "inputFormTextBox1"; textbox.TextMode = TextBoxMode.MultiLine; textbox.Rows = 5; textbox.Columns = 75;
There are a number of properties/attributes that you can set:
- ID: control id.
- Text: the string within the control.
- ErrorMessage: you can define a custom error message that will be displayed when an error occurs.
- ErrorMessageLabelControl: you can specify a control id of a control on the page in which the error message will be rendered.
- TextMode: accepts a value of type TextBoxMode. Possible values are MultiLine, SingleLine and Password. The default is SingleLine.
- Columns: indicates the width of the text box.
- Rows: indicates the number of rows that will be displayed. This is only applied if the TextMode property is set to MultiLine.
- RichText: indicates if a normal text box or a rich text box will be displayed. The default value is false. The text box will only be rendered as a rich text box if the TextMode property is set to MultiLine.
- RichTextBoxMode: accepts a value of type SPRichTextMode. Possible values are Compatible, FullHtml and HtmlAsXml. The default value is Compatible. this property only applies if the RichText property is set to true.
- AllowHyperlink: this property only applies if the RichtText property is set to true. The necessary controls to insert hyperlinks and images will be added to the tools pane.
- Direction: This orders the controls in the tools pane from left to right or from right to left. The value is of type ContentDirection having values NotSet, LeftToRight, RightToLeft. The default value is NotSet. This property only applies if the RichText property is set to true.
When opting for rich text mode, there can be problems with the width of the control. If you want to render the control over the full width of the page, you can read this post from Dario Martirani.


Hi Karine,
How can I add spuc:InputFormTextBox on my custom ascx???
Later, I would place my custom ascx on webpart.
Thanks & Regards
Khushi
Hi,
I have added InputFormTextBox control in one .ascx but on postback data from InputFormTextBox get disappear.
I mean control not render with it’s content. Do you have any idea
Thanks & Regards,
Sarika
Can you post your code?
I have tried this in the past and it did notwork. Also the RichText Icons do not show.
Added InputFormTextBox control in .ascx as
Then on same .ascx I have one fileupload control… Which upload the attachment. when upload any attachment, page get postback. Same time data from InputFormText control became empty.
if I check inFormTxtBody.text it gives me the data which I had added. but control not showing the data.
I notice one thing Control is render as . data is not in TextArea.
Hi,
I have InputFormTextBox used in some custom pages in SharePoint 2007 applications. Now I am migrating these pages to SharePoint 2010. But the toolbar of InputFormTextBox is completely distorted. It has all “B” “B” “B” in place of images on buttons on toolbar. Any idea if InputFormTextBox is compatible with SharePoint 2010? I am using some master pages from SharePoint 2007. Would that cause the issue?
Regards,
Rahul Khedekar.
i am also facing same problem
Hi Rahul,
I just started to migrate the code from this SharePoint Demo project and I have no problem with the InputFormTextBox using this markup:
spuc:InputFormTextBox runat=”server” ID=”InputFormTextBox3″ TextMode=”MultiLine” Columns=”100″ Rows=”12″
RichText=”true” RichTextMode=”FullHtml” AllowHyperlink=”true” Direction=”NotSet”
(the XML tags are left out, otherwise it wouldn’t render)
What’s the markup you use?
Karine
Hi Karine,
I am also facing the same problem using the custom web part.
_txt.TextMode = TextBoxMode.MultiLine;
_txt.Rows = 10;_txt.RichText = true;
_txt.RichTextMode = SPRichTextMode.FullHtml;
I use it from within a custom application page. Perhaps it has something to do with the width of the webpart. I’ll try it out during the weekend and post my findings.
Karine
Hi, I am using a SharePoint’s text box control in one of my task edit forms for workflow. My problem is the lack of flexibility when it comes to culture specific characters. I would like to use Cyrilic letters, but it seems that this and other SharePoint controls use ASCII instead of Unicode.
Am I missing something here? Any reply would be appriciated.
Thanks in advance
Hi Karine,
I have created a webpart using inputformtextbox. But when I click the image button, I doesn’t show the browse option for the image.
Any property setting is there?
Thanks in advance,
Thanks a lot .
Hi Karine,
How can we add Sharepoint 2010′s Enhanced Rich Text Box to my visual web part? Thanks in advance.
As the visual web part also contains an .ascx control, you can add the InputTextBox control the same way as explained in this post, and set the properties correctly to have it behave as a Richt text box.
Hi Karine,
I have got an issue in SharePoint 2010 site. This site has been upgraded from SharePoint 2007 and we did’t do visual upgrade on this site. The rich text box behaving quite weird. All the icons at the top bar repeating multiple times.
Any idea how to fix it.
Thanks
Hi Faisal,
I’m afraid I can’t help hou on this: I haven’t tested this out in a scenario where no visual upgrade was performed. I advise you tyo place your question on the SharePoint forum, there you will have more chance for an answer.
Kind regards,
Karine