I have a bootstrap modal which contains a textbox and a numeric keypad inside, so when you click on a button, you must "type" the number of the button in the textbox. The problem is that clicking any button (on the modal's keyboard) closes the modal. The number does stay written but to see it I have to open the modal again. Is there a way to make the modal not close?
I read that it can be solved by placing an updatepanel inside the modal body to avoid autopostback... but I have no idea how.
<!--VENTANA MODAL -->
<div class="modal fade" id="recep" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header" style="align-content:center">
<h2 class="modal-title" id="exampleModalLabel">TITULO MODAL</h2>
</div>
<div class="form-group" >
<div class="modal-body" style="align-content:center;">
<h2 style="text-align: justify">Ingrese un numero:</h2>
<!--teclado numerico -->
<asp:Button ID="b0" runat="server" Text="0" OnClick="b0_Click"/>
<asp:Button ID="b1" runat="server" Text="1" OnClick="b1_Click"/>
<asp:... etc...
<!--textbox -->
<asp:textbox id="sem" runat="server" autocomplete="off"></asp:textbox>
</div>
</div>
<!--cerrar -->
<div class="modal-footer" style="align-content:center">
<asp:Button id="cr" runat="server" data-dismiss="modal" text="CANCELAR" />
<!--guardar-->
<asp:Button id="RR" runat="server" text="ACEPTAR" OnClick="RR_Click"/>
</div>
</div>
</div>
</div>
<!--VENTANA MODAL -->
webform aspx.cs
protected void b0_Click(object sender, EventArgs e)
{
sem.Text = sem.Text + "0";
}
Anything you let me know, remember that the Ids you put on the server change when you are in the browser.