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

  • Home
  • SEARCH
  • 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 3315420
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:20:53+00:00 2026-05-17T22:20:53+00:00

I have a chunk of code that on page load with populates some of

  • 0

I have a chunk of code that on page load with populates some of or all of the following labels. It should have two labels per line ( needs a line break after each xData label). The problem I am having is that since the number of labels with data and set to visable on page load changes, the br / tags cause spacing issues when not all labels are visible.

<div id="Status">
    <asp:Label ID="1" runat="server" Text="1:" Width="125px" Visible="false" />
    <asp:Label ID="1Data" runat="server" Text="" Visible="false" />
    <asp:Label ID="2" runat="server" Text="2:" Width="125px" Visible="false" />
    <asp:Label ID="2Data" runat="server" Text="" Visible="false" />
    <asp:Label ID="3" runat="server" Text="3:" Width="125px" Visible="false" />
    <asp:Label ID="3Data" runat="server" Text="" Visible="false" />
</div>

I would like to be able to add the line breaks after each “xData” label in the code behind when the labels are filled and set to visible.

I have tried adding "\n" to the label text and\or Environment.NewLine with no luck.

Thanks for any help

  • 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-17T22:20:54+00:00Added an answer on May 17, 2026 at 10:20 pm

    The easy way…

    <div id="Status">
        <div id="Status1" runat="server" Visible="false">
            <asp:Label ID="1" runat="server" Text="1:" Width="125px" />
            <asp:Label ID="1Data" runat="server" Text="" />
        </div>
        <div id="Status2" runat="server" Visible="false">
            <asp:Label ID="2" runat="server" Text="2:" Width="125px" />
            <asp:Label ID="2Data" runat="server" Text="" />
        </div>
        <div id="Status3" runat="server" Visible="false">
            <asp:Label ID="3" runat="server" Text="2:" Width="125px" />
            <asp:Label ID="3Data" runat="server" Text="" />
        </div>
    </div>
    

    The right way…

    <div id="Status">
        <asp:Label CssClass="statusLabel" ID="1" runat="server" Text="1:" Width="125px" Visible="false" />
        <asp:Label ID="1Data" runat="server" Text="" Visible="false" />
        <asp:Label CssClass="statusLabel" ID="2" runat="server" Text="2:" Width="125px" Visible="false" />
        <asp:Label ID="2Data" runat="server" Text="" Visible="false" />
        <asp:Label CssClass="statusLabel" ID="3" runat="server" Text="3:" Width="125px" Visible="false" />
        <asp:Label ID="3Data" runat="server" Text="" Visible="false" />
    </div>
    
    /* CSS */
    #Status span {
      display: block;
    }
    #Status .statusLabel {
      clear: both;
      float: left;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a chunk of code that defines div s and some of the
I have the following code that requests the Google.com homepage and sends the page
I have a chunk of code where it appears that a variable is changing
I have a chunk of HTML code (with some PHP vars echoed inside of
Let's say you have the following chunk of code: <div id=container> <someelement>This is any
I came across the following weird chunk of code.Imagine you have the following typedef:
I have written a chunk of code that is aimed at reordering pages. <form
I have the following chunk of code in my footer.phtml <!-- Customer Modal -->
The situation is that I have a page that uses some AJAX calls to
I have the following chunk of HTML code but i cant figure how i

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.