I found this answer, but get the following error:
script:
<script type="text/javascript">
function Closepopup() {
debugger;
$('#myModal').modal('close');
}
</script>
code-behind:
ScriptManager.RegisterStartupScript(Me, Me.GetType, "Close Modal Popup", "Closepopup();", True)
error:
Unhandled exception at line 6, column 13594 in http://localhost:1230/Scripts/bootstrap.min.js
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'close'
Any ideas appreciated!
modal('toggle')
instead of modal(toggle)
$(function () {
$('#modal').modal('toggle');
});
Try $('#myModal').modal('hide');
instead of $('#myModal').modal('close');
User contributions licensed under CC BY-SA 3.0