ASP.NET - usercontrol and lable show in same line inside td

Asked By msakt on 08-Jun-12 01:38 AM
<td class="TLeft">
                         
                            <uc1:time ID="txtStartTime" runat="server"  />
                            
                           <div style="float:left" >
                           <asp:Label ID="lblOptional0" runat="server" ForeColor="#0066FF" Text="(Optional)"></asp:Label>
                              </div>
                          </td>
Ravi Maurya replied to msakt on 08-Jun-12 01:43 AM
Try by adding style="white-space: nowrap;" to your td
TSN ... replied to msakt on 08-Jun-12 01:59 AM
Hi...
 Just use a  Brealk tag after the userControl

<td class="TLeft">

<uc1:time ID="txtStartTime" runat="server" />
<br/>
<div style="float:left" >
<asp:Label ID="lblOptional0" runat="server" ForeColor="#0066FF" Text="(Optional)"></asp:Label>
</div>
</td>
Chintan Vaghela replied to msakt on 08-Jun-12 02:20 AM

Hi Frndz,

 

Functionality ::  UserControl and label display in Same line

 

 

 

Take one table inside td.

 

Now in this table take two different td to achieve you task.

 

 

 

ASPX Page Code  ::

 

 

 

<td class="TLeft">

      <table cellpadding="0" cellspacing="0" width="100%">

        <tr>

          <td>

            <uc1:time id="txtStartTime" runat="server" />

          </td>

          <td>

            <asp:Label ID="lblOptional0" runat="server" ForeColor="#0066FF" Text="(Optional)"></asp:Label>

          </td>

        </tr>

      </table>

    </td>

 

 

Hope this helpful!

Thanks

 

Jitendra Faye replied to msakt on 08-Jun-12 03:03 AM
If you want to show in same line then-

<td class="TLeft">
   <uc1:time ID="txtStartTime" runat="server"  />
   <asp:Label ID="lblOptional0" runat="server" ForeColor="#0066FF" Text="(Optional)"></asp:Label>
</td>


If you want to show in second line then-



<td class="TLeft">
   <uc1:time ID="txtStartTime" runat="server"  />
    <br/>
   <asp:Label ID="lblOptional0" runat="server" ForeColor="#0066FF" Text="(Optional)"></asp:Label>
</td>