Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7666073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:44:31+00:00 2026-05-31T14:44:31+00:00

I have this code and this one has more than one data from the

  • 0

I have this code and this one has more than one data from the database

so my expected output is

1.line1

2.line2

but with this code i get

1.line12.line2

but the data from the database have nextline on it.

this is the code

 <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
 <ItemTemplate>

<%# Eval("News_data") %>

 </ItemTemplate>
 </asp:ListView>

from this database

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TDBSConnectionString %>" 
                            SelectCommand="SELECT [news], [news_date],[news_data] FROM [ibsi.news]">
                        </asp:SqlDataSource>

this is the sample pics.

this is the DB

this is the output

Ouput

when i use pre tag

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:44:32+00:00Added an answer on May 31, 2026 at 2:44 pm

    You can easily replace it as that’s normally (you own the database, so you will know better) a hidden character like Line Feed char…

    if it is, try this:

    <%# Eval("News_data").ToString().Replace("\n", "<br/>") %>
    

    This happens for example if you are grabbing the data from a multirow textbox without convert it before.

    \n\r is the same as (chr)13 + (chr)10 witch means LF (Line Feed), CR (Carriage Return).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that has one button that let's me choose an entry
I usually do not have difficulty to read JavaScript code but for this one
I have a Linq List in which have data more than one tables and
I am creating a rails app and have used this code in one of
I have this code to open multiple files one at a time that is
I have this code: s(x => x.Open()); s is a method which calls one
I'm training code problems like UvA and I have this one in which I
I have a piece of code VERY similar to this one http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailFetching I the
I've seen second one in another's code and I suppose this length comparison have
Racking my brains on this one. I have the code below: the first stages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.