Question How can I extract and display line breaks from SQL text into .NET 4 VB label

nthoeming

New member
Joined
Apr 30, 2012
Messages
3
Programming Experience
1-3
In classic ASP, I was able to use this VB code to find carriage returns in SQL query results and add them as Line Breaks to displayed text.

<% Dim Notes
Notes = escape(WorkOrderDetails.Fields.Item("note_text").Value)
Notes = Replace(Notes, "%0D", "<br>")
Notes = unescape(Notes) %>
<td class="wo_details"><%=Notes%> </td>


This will not work in .NET 4.0 VB.
Here's my new .NET 4.0, VBScript version so far (I've changed the name of the SQLDataSource):

<td class="wo_details"><asp:Label ID="note_textLabel" runat="server" Text='<%# Eval("note_text") %>' /><br /> </td>

Any help would be greatly appreciated
 
VB.NET:
<td class="wo_details"><asp:Label ID="note_textLabel" runat="server" Text='<%# Eval("note_text").ToString.Replace(vbcr, "<br />") %>' /><br /> </td>

I dont mean to be picky (actually, maybe I do!) but that isn't vbscript, its vb.net :)
 
Back
Top