locked
Adding bootstrap elements to asp textbox RRS feed

  • Question

  • User-1664485818 posted

    Hi folks, I am trying to add twitter bootstrap to my textboxes/button any help appreciated.

    <div class = "col-lg-3 input-group input-group-lg">
       <asp:TextBox ID="Button1" runat="server" CssClass="form-control" OnClick="Button1_Click" placeholder="ASP Bootstrap" aria-describedby="basic-addon2"></asp:TextBox>
       <span class="input-group-addon" id="12">Go</span>
    </div>

     

             protected void Button1_Click(object sender, EventArgs e)
            {
    
            }

     

    Friday, July 8, 2016 8:18 AM

Answers

All replies

  • User-1377768212 posted

    Hi,

    Hi folks, I am trying to add twitter bootstrap to my textboxes/button any help appreciated.

    Check these similar threads :

    http://stackoverflow.com/questions/20114090/bootstrap-input-component-with-asp-net-textbox

    http://stackoverflow.com/questions/9549623/twitter-bootstrap-with-asp-net-not-mvc?rq=1

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 8, 2016 10:20 AM
  • User-1664485818 posted

    Thanks rajeeshmenot, but still having problems adding a button onto the side of textbox....

    Friday, July 8, 2016 12:35 PM
  • User-1664485818 posted

    Does anyone know how to apply asp properties to the button within textbox

    <div class="input-group">
        <input type="text" class="form-control" placeholder="Search text">
        <span class="input-group-btn" style="width:0;">
            <button class="btn btn-default" type="button">Go!</button>
        </span>
    </div>
    
    


     

    Friday, July 8, 2016 1:23 PM
  • User61956409 posted

    Hi brucey,

    We could apply bootstrap classes to asp.net controls, you could try the following sample code.

    <div class="input-group">
        <%--<input type="text" class="form-control" placeholder="Search text" />--%>
        <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control" placeholder="Search text"></asp:TextBox>
        <span class="input-group-btn" style="width: 0;">
            <%--<button class="btn btn-default" type="button">Go!</button>--%>
            <asp:Button ID="Button1" runat="server" CssClass="btn btn-default" Text="Go!" OnClick="Button1_Click" />
        </span>
    </div>
    

    Best Regards,

    Fei Han

    Monday, July 11, 2016 6:05 AM