Web Forms :: Display Only The Last Line Of A Multiline TextBox?
Sep 24, 2010
On my Asp.Net GridView I am binding a textbox to a field in SQL. Sometimes the content of the textbox is more than 1 line and I
need to show only the LAST line. How can I do that? Here is part of my code...notice that I use Rows=1 on purpose so that I am able to show only 1 line but I need it to scroll all the way down and have it show only the last line of the whole content:
1) Is it possible, in a multiline textbox, to automatically break to the next line after 100 characters? 2) If not, is it possible to parse the enter key as entered by the user to break the line in the code behind?
Some additional info:
The person requesting this does not think that the user should use a single line textbox limited to 100 characters and click an "Add Line" button to store that field in a table.
The person requesting this is of the belief that a DEC Alpha-based system that currently does this can be replicated on the web.
No problem there, but when I want to display the saved data into a multiline textbox (for editing) i can't get the linebreak to display.
I've tried these option, but nothing seems to work:
- txtMulitline.text = .item("field").tostring.replace("<br />", environment.newline) ' This displays some empty spaces but no new lines - txtMulitline.text = .item("field").tostring.replace("<br />", vbcrlf) ' same result - txtMulitline.text = .item("field").tostring.replace("<br />", vbnewline) ' same result - txtMulitline.text = .item("field").tostring.replace("<br />", " ") ' This display the string like "blabla blibli" but no new lines - txtMulitline.text = .item("field").tostring.replace("<br />", " ") ' same result - txtMulitline.text = .item("field").tostring.replace("<br />", " ") ' same result
I have a set of data is my database. Need to pull the data and display in a textbox which is set to Multiline mode. The problem is i need to display the that is being retrieved from database is a particular format with line breaks.
INT/1241/STD3//TestCondition/ Info:<data> Test Criteria:<data> Test Results:<data> Conclusion:<data> Tested by:<data>
This is the pattern in which i want to display the details in the text box. All Data is retrieved from data base, there is a line break after each line.
I am developing a message pool means like a Facebook when we click on above message icon all message show in list .then click on the sender name all message show that person. For
That kind of message poll am developed two pages one page is sender and the other one is receiver .when I send message from sender page it will be saved into data base and show into other pages text box.
Now problem is that the receiver pages cannot show all messages .it will show one first message which are saved into database.
I want it will show all messages which are sending from sender page. below my all code.
WebForm1.aspx.css using System; using System.Collections.Generic; using System.Linq;
How to prevent the new line character at the beginning of the text entering in a multiline text box? Now, I already trimmed the white space at the beginning of the text. but i can't prevent the new line character that has to be occurred by entering the enter key on the most beginning of the text box.
i have one textbox with property TextMode="MultiLine"on my aspx page(C#)i entered data in that textbox & press enter to write next linebut while saving that multi line data in database it saves only single line data,it skips 2nd, 3rd, 4th.......... line.