locked
Button & text in 1 line RRS feed

  • Question

  • User-797751191 posted

    Hi

      I want textbox & button i 1 line

    <div class="form-group">
    <label>Document No</label>
    <div class="form-group">
    <asp:TextBox ID="txtInvoiceNo" Style="color: green;" AutoComplete="off" class="form-control col-md-2" runat="server"></asp:TextBox>
    <asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" class="form-control col-md-2" Enabled = "false" Text="Print" />
    </div>
    </div>

    Thanks

    Thursday, July 18, 2019 7:31 AM

Answers

  • User-2054057000 posted

    Instead of this:

    <asp:TextBox ID="txtInvoiceNo" Style="color: green;" AutoComplete="off" class="form-control col-md-2" runat="server"></asp:TextBox>
    <asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" class="form-control col-md-2" Enabled = "false" Text="Print" />

    Put this:

    <div style="float: left; width: 49%">    
        <asp:TextBox ID="txtInvoiceNo" Style="color: green;" AutoComplete="off" class="form-control col-md-2" runat="server"></asp:TextBox>
    </div>
    
    <div style="float: left; width: 49%">
        <asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" class="form-control col-md-2" Enabled = "false" Text="Print" />
    </div>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 18, 2019 12:27 PM

All replies

  • User-719153870 posted

    Hi jsshivalik,

    You can display the two controls on the same line by adding a "display: inline" style to your textbox.

    Please refer to below codes:

    <div class="form-group" style="float:left">
                <label>Document No</label>
                <div class="form-group">
                    <asp:TextBox ID="txtInvoiceNo" Style="color: green;display:inline;" AutoComplete="off" class="form-control col-md-2" runat="server"></asp:TextBox>
                    <asp:Button ID="btnPrint" runat="server"  class="form-control col-md-2" Enabled="false" Text="Print" />
                </div>
            </div>

    Here is result of this demo:

    Best Regard,

    Yang Shen

    Thursday, July 18, 2019 8:45 AM
  • User-2054057000 posted

    Instead of this:

    <asp:TextBox ID="txtInvoiceNo" Style="color: green;" AutoComplete="off" class="form-control col-md-2" runat="server"></asp:TextBox>
    <asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" class="form-control col-md-2" Enabled = "false" Text="Print" />

    Put this:

    <div style="float: left; width: 49%">    
        <asp:TextBox ID="txtInvoiceNo" Style="color: green;" AutoComplete="off" class="form-control col-md-2" runat="server"></asp:TextBox>
    </div>
    
    <div style="float: left; width: 49%">
        <asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" class="form-control col-md-2" Enabled = "false" Text="Print" />
    </div>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 18, 2019 12:27 PM