When using modal:true we have to use ajax call for firing the button in jquery modal popup or else we can use another method.
<pre lang="Javascript"><pre lang="Javascript"><script type="text/javascript">
$(function () {
$("#modal_dialog").dialog({
title: "Manage Branch",
autoOpen: false,
width: 400,
open: function () {
$('#disableBackGround').attr('style', 'display:block');
},
buttons: {
ADD: function () {
var textvalue = $("#<%=TextBox2.ClientID%>").val();
$('#<%= hndtxt.ClientID %>').val(textvalue);
$('#<%=add.ClientID %>').click();
},
Close: function () {
$('#disableBackGround').attr('style', 'display:none');
$(this).dialog('close');
}
}
});
$("[id*=btnadd]").live("click", function () {
$("#modal_dialog").dialog('open');
return false;
});
});
</script>
<input type="button" id="btnadd" value="Add Branch" name="btnadd" style="float: right" />
<asp:button id="add" runat="server" text="ADD" style="display: none" onclick="btninsert_Click">