User1557998713 posted
I have a form with several lines. Depending on the value of one Select control, some Labels and Texts controls are hidden by codebehind. Example of Form Line:
Label1:Text1<margin>Label2:Text2<margin>Label3:Text3<margin>Label4:Text4<margin>
1.- If I hide Label1:Text1, Label2:Text2 and Label3:Text3 it shows:
<margin><margin><margin>Label4:Text4<margin>
I want Label4 not to start with blank margins at the beginning of the line:
Label4:Text4
2.- If I hide Label2:Text2 and Label3:Text3 it shows:
Label1:Text1<margin><margin><margin>Label4:Text4<margin>
I want there to be only one <margin> between Label1:Text1 and Label4:Text4:
Label1:Text1<margin>Label4:Text4.
My Code:
.mycss { white-space:nowrap; margin-right:5px; }
.labels { font-weight:bold; color:#5E5E5E; }
<span class="mycss">
<span id="Form_Label1" class="labels">
<asp:TextBox id="Form_Texto1">
</span>
<span class="mycss">
<span id="Form_Label2" class="labels">
<asp:TextBox id="Form_Texto2">
</span>
<span class="mycss">
<span id="Form_Label3" class="labels">
<asp:TextBox id="Form_Texto3">
</span>
<span class="mycss">
<span id="Form_Label4" class="labels">
<asp:TextBox id="Form_Texto4">
</span>
<asp:textbox id="Form_Texto1"> </asp:textbox>
<asp:textbox id="Form_Texto2"> </asp:textbox>
<asp:textbox id="Form_Texto3"> </asp:textbox>
<asp:textbox id="Form_Texto4"> </asp:textbox>