Estoy tratando de mostrar un mensaje de bootstrap al momento de inserter datos en mi base de datos pero al dar click se realiza un postback y el modal desaparece...
<div class="container">
<div class="modal fade" id="user_Modal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="padding: 35px 50px;">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3><span class="glyphicon glyphicon-user"></span>  New Usuario</h3>
</div>
<div class="modal-body" style="padding: 40px 50px;">
<div class="row">
Many others Div's
<!-- /.col-lg-6 -->
<div class="col-lg-6">
<div class="input-group">
<asp:Button ID="Button1" runat="server" CausesValidation="true" ValidationGroup="User_group" class="btn btn-success" Text="Guardar" OnClick="Btn_submitData" />
</div>
<br />
</div>
<!-- /.row -->
<div class="col-lg-6" id="alertSuccess" runat="server" style="display:none">
<div class="alert alert-success">
<strong>Success!</strong> The user has been insert.
</div>
</div>
<div class="col-lg-6" id="alertFail" runat="server" style="display:none">
<div class="alert alert-danger">
<strong>Fail!</strong> Something went wrong, please try again.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Este es mi codigo
protected void Btn_submitData(object sender, EventArgs e)
{
String myConnectionString = @"C:\Users\gutiece\Desktop\" + "tool_track.accdb";
using (OleDbConnection connection = new OleDbConnection())
{
using (OleDbCommand command = new OleDbCommand())
{
connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0; Data source= " + myConnectionString;
command.Connection = connection;
connection.Open();
command.Parameters.AddWithValue("@WHO", Txt_who.Text.Trim());
command.Parameters.AddWithValue("@PAYROLL_NUMBER", Convert.ToInt32(Txt_pay.Text));
command.Parameters.AddWithValue("@NAME", Txt_name.Text.Trim());
command.Parameters.AddWithValue("@OU", Txt_ou.Text.Trim());
command.Parameters.AddWithValue("@POOL", Convert.ToInt32(Txt_pool.Text));
command.Parameters.AddWithValue("@TEAM", Convert.ToInt32(Txt_team.Text));
command.Parameters.AddWithValue("@PASSWORD", Txt_pass.Text.Trim());
command.Parameters.AddWithValue("@ROL", Txt_rol.Text.Trim());
try
{
command.CommandText = "INSERT INTO users (who, payroll_number, name, ou, pool, team, pass, rol) VALUES ([@WHO], [@PAYROLL_NUMBER], [@NAME], [@OU], [@POOL], [@TEAM],[@PASSWORD], [@ROL])";
command.ExecuteNonQuery();
alertSuccess.Visible = true;
}
catch (Exception)
{
alertFail.Visible = true;
}
connection.Close();
}
}
}