about displaying data in datalist control

  • Thread starter Thread starter Yoshitha
  • Start date Start date
Y

Yoshitha

hi

I have datalist control in my ASP.NET application
the problem here is
i have used a textbox with multiline true propertly when i enter data like

"fdjsfhjksdhfjsdfhsdjhfsdfhsdjfhsd
jfdsjfksdjfksdjkfjsdfjksdjfsdjfd
fdsfhjsdhfjsdhfjf dsjf dsjfhjsdfhjksdh d fdsjf
hsdjkfhdjsfhsdjfh ds
fdsf dshfjdhsjfhsdjhfjsdh fds
dsjfh sdfhdsfjdshfjhdsfds"

it is storing as it is ...when i displaying in the datalist like this
Dim con As New

OleDbConnection("provider=sqloledb;server=localhost;database=tempdb;trusted_
connection=Yes")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles

MyBase.Load
Dim da As New OleDbDataAdapter("select * from Message", con)
Dim ds As New DataSet
da.Fill(ds, "Message")
dltMessages.DataSource = ds
dltMessages.DataBind()
End Sub
it is showing in a single line it is not displaying in paragrah wise .......

how to display data in data list as it is.
Please help me ....

thanx in advance
yoshitha
 
yourString.Replace(Environment.NewLine, "<br>")

Try this.....
becasue when displaying the text in the datalist the browser reads it as
html, try using the Replace(Environment.NewLine, "<br>") when storing the
text in the db to replace each LineBreak with <br> in the database so when
getting the value the browser reades the <br> as tags and replaces them with
a Break line.
 
Back
Top