multiline label control in the datalist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ria12
    New Member
    • Feb 2009
    • 26

    multiline label control in the datalist

    Hello,kindly request you to plz help me.....
    I have label control in the datalist.I want to display the text in this label with line breaks....Plz help me......Thks in advance.
    Last edited by Frinavale; Mar 2 '09, 02:13 PM. Reason: Moved to ASP.NET answers from Insights
  • bhupinder
    New Member
    • Feb 2009
    • 32

    #2
    multiline label control in the datalist

    Originally posted by Ria12
    Hello,kindly request you to plz help me.....
    I have label control in the datalist.I want to display the text in this label with line breaks....Plz help me......Thks in advance.
    You can do by loop. at the first you have to check length on rowdatabound event then show in label

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      HTML <br /> will add a new line.
      So when you're adding text to the label, be sure to add a "<br />" when ever you want a new line.

      Comment

      • Ria12
        New Member
        • Feb 2009
        • 26

        #4
        Thks for your replies..
        But i want to make it clear , i cannot insert line breaks in HTML coz i am binding the data from database....Can you plz explain me the loop that i have to write in row data bound....?

        Comment

        • alamodgal
          New Member
          • Dec 2008
          • 38

          #5
          Refer this link


          A broad category of Microsoft tools, languages, and frameworks for software development. Designed to support developers in building, debugging, and deploying applications across various platforms.

          Comment

          • Ria12
            New Member
            • Feb 2009
            • 26

            #6
            Thks for sending this link ......I got the answer !!!

            Comment

            • ganeshjamdurkar
              New Member
              • Sep 2013
              • 1

              #7
              Try This

              <asp:Label ID="CommentLabe l" runat="server" Text='<%# Eval("Comment") .ToString().Rep lace(Environmen t.NewLine, "<br />") %>' />

              Comment

              Working...