Replace vbCrLf

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
 
D

David C

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 />")
 
L

Lloyd Sheen

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
 
J

Jonathan Wood

You want someone to help debug an error without saying what that error is?
 
B

b_wind

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top