I'm using C#.NET with webforms. I create a control to find subjects on my database. This control has a textbox and a button. The button can be hidden/removed sometimes, and that's the problem!
When the button is visible, html render ok. But when the button is hidden/removed, the html gets broken...
My html is like this:
<div class="input-group">
<asp:TextBox runat="server" ID="SubjectTextBox" CssClass="SubjectTextBox form-control"></asp:TextBox>
<span class="input-group-btn">
<button id="SearchSubjectBtn" class="btn btn-default" type="button" runat="server">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span> Search
</button>
</span>
</div>
Which renders like this:
How can I fix the html, so it could render in the correct form?
I know I could just remove the "input-group" class from the "div", but I don't want to do this by C#. The reason, is that I don't want to manage css on my code.
Actually, just remove the class, will work, but will not be correct, right?
There is a way to do that easily?