JB4375
asked on
ASP.Net Multi-Line Textbox. Display Text on Multiple Line in Ouput.
I have a form that collects data for Server backup requests. At the bottom of the form is a multiline textbox to enter the File Systems/Drives to be backed up.
They are instructed to enter one file system, or drive path per line, e.g.
C:\Users
D:\Data\
E:\Images
Is there any way to keep the return in the output to that it still appears as one path to a line?
Thanks,
JB
They are instructed to enter one file system, or drive path per line, e.g.
C:\Users
D:\Data\
E:\Images
Is there any way to keep the return in the output to that it still appears as one path to a line?
Thanks,
JB
Hmmm. The value should be a string - aren't there carriage return and line feed characters in there? What are you doing with the value once you capture it?
ASKER
All the data is inserted into a SQL table, as well as being sent out in an email to the person responsible for setting up the backups.
At this point it's merely displaying information from the textbox as textbox20.text. I know this won't hold line feed characters. Just wasn't sure how to go about doing it.
At this point it's merely displaying information from the textbox as textbox20.text. I know this won't hold line feed characters. Just wasn't sure how to go about doing it.
Make a Complete String like this
string s="C:\Users" + "\r\n" + "D:\Data\" + "\r\n" + "E:\Images";
TextBox1.Text=s;
I think it uses VBLF to break the lines so what you can do is either
Dim drives as String() = txtDrives.Text.Split(VBLF)
or if you want to save it as a single string but with line breaks then
Dim drives as String = txtDrives.Text.Replace(VBL F, VBCRLF)
Dim drives as String() = txtDrives.Text.Split(VBLF)
or if you want to save it as a single string but with line breaks then
Dim drives as String = txtDrives.Text.Replace(VBL
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Take a HTML TextArea and set property runat="server"
string s="C:\\Users" + "\r\n" + "D:\\Data\\" + "\r\n" + "E:\\Images";
TextArea1.Value = s;
string s="C:\\Users" + "\r\n" + "D:\\Data\\" + "\r\n" + "E:\\Images";
TextArea1.Value = s;
ASKER
Wow,
That was a brilliant read on what I thought was a fairly good description of the problem until I read yours Andrei. LOL.
Your solution worked perfectly on the first try.
Thanks!!
That was a brilliant read on what I thought was a fairly good description of the problem until I read yours Andrei. LOL.
Your solution worked perfectly on the first try.
Thanks!!