Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting a line break like vbcrlf in a text box

Status
Not open for further replies.

tmar

MIS
Mar 24, 2007
62
US
I'm trying to read information from a database and combine it into a string character and then display that string character in a text box.

In vb you'd use vbcrlf which isn't putting the line returns in. I've looked this up on other sites and see the response to replace vbcrlf with <br> or even <br/> and I've tried both but neither put a line break in the text in the text box.

My code is..
Code:
            While reader.Read
                ndate = reader.GetValue(1)
                notes = notes & ndate.ToShortDateString & " - " & reader.GetValue(0).ToString & vbCrLf & reader.GetValue(2).ToString & vbCrLf
            End While
            conn.Close()
            conn.Dispose()
            Replace(notes, vbCrLf, "<br/>")
            Me.txtWONotes.Text = notes
 
first off input type text, line breaks wont be visible without modification to the box, if you want the visible line breaks utilize a text area, as for specifically an input type text the line breaks go between the value attributes, and they would still be vbcrlf's just you wont see it in the box, but either as multiline visible only through a one line window, or it'll appear as one long line with ascii character bars/boxes indicating the line breaks

as for a text area you use <textarea><%=value%></textarea>

and the line breaks are auto, unless oyu've stored them with the <BR>'s then you'll need to replace them back out.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top