471,089 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

about displaying data in datalist control

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=localhos t;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
Sep 8 '05 #1
1 2109
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.
"Yoshitha" wrote:
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=localhos t;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

Sep 8 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Martin | last post: by
10 posts views Thread by Bharat | last post: by
3 posts views Thread by bbernieb | last post: by
1 post views Thread by Yoshitha | last post: by
1 post views Thread by Yoshitha | last post: by
3 posts views Thread by Richard Carpenter | last post: by
12 posts views Thread by brwalias | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.