Hii tanws8,
Please refer below sample.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
function OnPostReponseModal() {
$('#UpdateSucessModal').modal('show');
setTimeout(function () {
window.location.href = '/Stage3/Index';
}, 2000);
}
</script>
</head>
<body class="container">
<form id="form1" runat="server">
<section class="m-t2 m-b4">
<button type="submit" runat="server" class="btn btn-danger" onserverclick="OnPost">
Reject
</button>
</section>
<div class="modal" tabindex="-1" role="dialog" id="UpdateSucessModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal Title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Modal Body
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</form>
</body>
</html>
Code
C#
protected void OnPost(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "OnPostReponseModal();", true);
}
VB.Net
Protected Sub OnPost(ByVal sender As Object, ByVal e As EventArgs)
ClientScript.RegisterStartupScript(Me.GetType(), "Redirect", "OnPostReponseModal();", True)
End Sub