473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2239
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format....
0
by: Alex | last post by:
Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Configuration Public Class Main : Inherits Page ...
4
by: Martin | last post by:
I want to build a data entry form for creating and updating info on something. When I'm first creating an item all the fields need to be editable. There after some fields become readonly. Most...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
3
by: bbernieb | last post by:
Hi, All, Is it possible to access a variable inside of a data binding, without the variable being out of scope? (Note: On the DataBinder line, I get an error message that says "Name 'i' is...
1
by: Yoshitha | last post by:
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...
1
by: Yoshitha | last post by:
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...
3
by: Richard Carpenter | last post by:
I understand how to use a dropdown list control to display the associated description value for a foreign key in a parent rather than the key itself, but I don't like having to disable the control...
12
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.