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 3214006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:00:36+00:00 2026-05-17T15:00:36+00:00

I had Datalist which retrieve aportion of atext from database and this text must

  • 0

I had Datalist which retrieve aportion of atext from database and this text must be format .as if there is (.) .it started in new line.
So how can I do that?

<asp:DataList ID="DataList1" runat="server">
    <ItemTemplate>
        <div class="scrollerDiv_open_about m10 ad_mun_font">
            <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("Id","~/Handlers/AboutUsImage.ashx?Id={0}") %>'
                Width="178" Height="115" Style="float: left; padding: 10px 10px 0 10px" />
                <span class="ad_mun_font_h"><asp:Label
                    ID="LblHeader" runat="server" Text='<%# Eval("Header") %>'></asp:Label></span>
                   <p>
            <asp:Label ID="LblText" runat="server" Text='<%# Eval("Text") %>'></asp:Label>.</p>
        </div>
    </ItemTemplate>
</asp:DataList>
  • 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-17T15:00:36+00:00Added an answer on May 17, 2026 at 3:00 pm

    Just use the Replace method, as follows:

        // In your code, s would be filled in from the database.
        string s = "This is trial text.  I want a line break after a period character (.).  I think this is what you mean but I am not certain."
    
        s = s.Replace(".", ".\n\r")
    

    Edit:

    Given that you are binding to a datasource, it would be better to act directly on the datasource instead. For example:

    foreach (var x in myDataSource)
    {
        x.TextField = x.TextField.Replace(".", ".\n\r");
    }
    
    myGridOrWhatever.DataSource = myDataSource;
    myGridOrWhatever.DataBind();
    

    I’m not with VS open, but I reckon this would work, so long as you are just using myDataSource to display stuff. If you were editing data in your grid or whatever, you might need to rethink this, but it should get you started.

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

Sidebar

Related Questions

Had this working; at one stage. The problem is the following text is now
I had run a contest where each record from the database was shown in
Had a question from a client which stumped me. They are using IIS 6.0
I had datalist as menu that display categories and subs and I want to
Had to download Command Line Tools from Apple to get make to work, but
Had received a module from CCAVENUE and it was working fine with Magento 1.6.2...
I had ddl which in selected changed it execute some code but when i
I had Drop down list which execute code when specific condition and I tried
Had no luck getting this to work via what I found on google.
Had a search around and can't seem to find any options to do this,

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.