Below is the JavaScript code that I have written:
<script>
$('#<%= btnOpen.ClientID %>').click(function (e) {
e.preventDefault();
$('#content').modal({ onOpen: function (dialog) {
dialog.overlay.fadeIn('slow', function () {
dialog.data.hide();
dialog.container.fadeIn('slow', function () {
dialog.data.slideDown('slow');
});
});
},
onClose: function (dialog) {
dialog.data.fadeOut('slow', function () {
dialog.container.slideUp('slow', function () {
dialog.overlay.fadeOut('slow', function () {
$.modal.close(); // must call this!
});
});
});
}
});
</script>
And here is the button used in my code:
<td>
<asp:Button ID="btnOpen" runat="server" Text="Open" ClientIDMode="Static" />
</td>
In the current scenario, clicking the button only triggers a page refresh.