Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a multiline textbox and I want to attach large amount of text to that textbox(say for example 3 to 4 pages).

That large amount of data pages contains paragraphs,headings, fonts,colors.....

Can anyone tell me how to attach large text to to the the textbox.

Thank you,
Posted

You can attach any number of data,

set
C#
textBox1.Multiline = true;
.

also take care of MaxLength, don't set too much which can cause problems
 
Share this answer
 
v2
Comments
Mohamed Mitwalli 23-Jun-12 5:40am    
5+
palcordis 23-Jun-12 5:40am    
Could you please tell for the following sample code to displayed in the multiline Textbox.

<ul><li>(i) First point; </li>
<li>(ii) Second Point; </li>

Thank you,
Mohamed Mitwalli 23-Jun-12 5:51am    
Check solution 3
Hi ,
If you saving your data with HTML TAGS and you want when you are retrieved apply this Format well my advice for you don't use TextBox
you can use HTML TAG like DIV but in this case you have to supply for ID="div1" runat="server" and use this attribute to apply format InnerHtml and for applying only text without format use InnerText
ASP.NET
<div id="div1" runat="server">
                  </div>

C#
div1.InnerHtml = ""; //applying format

div1.InnerText = ""; //only text

and for making your textbox take large numbers of letter it will be like that
XML
<asp:TextBox ID="TextBox1" runat="server" Height="492px" TextMode="MultiLine"
 Width="994px"></asp:TextBox>

Best Regards
M.Mitwalli
 
Share this answer
 
Comments
palcordis 23-Jun-12 6:01am    
Hello Mitwali,
Thank you for the reply but I am in bit confusion how to implement this.
Actually I need to display some set of Conditions or points that are read-only to be display in Textbox.

Any further help is appreciated.
sandeep nagabhairava 25-Jun-12 13:51pm    
hi Mohamed Mitwalli take my +5! ;)
Mohamed Mitwalli 26-Jun-12 1:13am    
Thanks sandeep :)
Set txtBox1.Multiline=true;
 
Share this answer
 
If you have a huge data like 3 to 4 pages then you can still do it using simple textbox but since you are saying you need HTML formatting, i would recommend you try FreeTextBox[^].

In any case, even if you use textbox with multiline of freetextbox, prefer using HTMLencode and HTMLdecode.
 
Share this answer
 
HI.....
USE THIS CODE MULTILINE TEXTBOX

C#
<asp:textbox id="TextBox1" runat="server" textmode="MultiLine" xmlns:asp="#unknown"></asp:textbox>


AND ASP.NET Multiline TextBox using jQuery CLICK IT
 
Share this answer
 
v2
Alternative way is Use fckeditor rather than textbox...its retain format of your text as it is

for more detail check on given link


http://www.tamilcodes.com/document.aspx?content=Tutorials&id=41[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900