<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 class="modal-title">
<asp:Label ID="lblTitlePopUp" runat="server" Text="Label"></asp:Label>
</h4>
</div>
<div class="modal-body">
<div class="col-sm-4">
<img src="res/img1.png" width="174" />
</div>
<div class="col-sm-8">
<asp:Label ID="lblMessage" runat="server" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">
Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<button type="button" style="display: none;" id="btnShowPopup" class="btn btn-primary btn-lg"
data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<script type="text/javascript">
function ShowPopup() {
$("#btnShowPopup").click();
}
</script>
c # code here
if (code == true)//se inserto
{
ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowPopup();", true);
this.lblTitlePopUp.Text = "Muy bien";
this.lblMessage.Text = "Muy bien, ya te encuentras inscrito en nuestra base de datos ahora pueden iniciar sesión.";
}
else //problemas al insertar
{
ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowPopup();", true);
this.lblTitlePopUp.Text = "Algo salio mal";
this.lblMessage.Text = "Tu registro no ha podido llevarse a cabo debido a que estamos presentando errores en nuestros servidores. Te sugerimos volver a intentarlo más tarde.";
}
Create your controls so that you can execute them on the server side by adding the tag of runat="Server". and Inside the moodal you can place the controls you want.