1
I have the following problem, I have this code on a page:
<div class="modal-footer">
<asp:Button runat="server" ID="btnCancelar" Text="Cancelar" class="btn btn-sm btn-danger" data-dismiss="modal" Width="90px" />
<asp:Button runat="server" ID="btnSalvar" Text="Gravar" class="btn btn-sm btn-primary" ClientIDMode="Static" Width="90px" OnClick="btnSalvar_Click" />
</div>
this page is loaded in two moments, when I will add records and when I will consult. When I edit the page, these buttons must be disabled. So I run the code in the codebehind below:
btnSalvar.Enabled = false;
btnCancelar.Enabled = false;
so these Htmls elements are rendered this way:
<div class="modal-footer">
<input type="submit" name="btnCancelar" value="Cancelar" id="btnCancelar" disabled="disabled" class="aspNetDisabled" data-dismiss="modal" style="width:90px;">
<input type="submit" name="btnSalvar" value="Gravar" id="btnSalvar" disabled="disabled" class="aspNetDisabled" style="width:90px;">
</div>
I know Framework 4.0 defines this style sheet "aspNetDisabled" when an element is disabled, but the problem is that it is overwriting the bootstrap css, which formats the button layout.
Have some configuration so that it does not overwrite style classes?
Try using in HTML
CssClass
ASP.NET, instead ofclass
. Or add the classes in codebehind thus:btnSalvar.Attributes.Add("class", "classe-que-eu-quero");
.– Douglas Garrido
I didn’t even notice I was using the class instead of Cssclass, that’s right..
– Gabriel Santos Reis