Replace vbCrLf

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

We have an asp.net page that displays data from a SQL table that is updated
from a VB application. That application uses vbCrLf to denote line breaks.
How can I replace them with "<br />" before they get displayed in my
GridView? Thanks.

David
 
I want to use option 1 but I get an error. Below is what I have in the row
databound event:

Dim varControl

varControl = e.Row.FindControl("EventNotes")

varControl.Text = Replace(varControl.Text, vbCrLf, "<br />")
 
David C said:
Nevermind. I looked at it again and the control name was misspelled.

David

Turn on your options Strict and Explicit.

Compiler will tell you most of your problems before you run.

LS
 
You can replace in SQL query or replace in datarowbind event.
suggest you replace in sql query, like:
select *,replace(TEXTFIELD,'
','<BR />') AS FIELD1 from table
 
Back
Top