Adding a <br /> after a label only if label is visible. C#
<p>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 <code>br /</code> tags cause spacing issues when not all labels are visible.</p>

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

<p>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.</p>

<p>I have tried adding <code>"\n"</code> to the label text and\or <code>Environment.NewLine</code> with no luck.</p>

<p>Thanks for any help</p>
