Button is not trigerring when i use modal:true, without including it works fine but the background is also active when the popup raises.
<script type="text/javascript">
$(function () {
$("[id*=btnadd]").live("click", function () {
$("#modal_dialog").dialog({
title: "Manage Branch",
autoopen: false,
width: 500,
buttons: {
ADD: function () {
var textvalue = $("#<%=TextBox2.ClientID%>").val();
$('#<%= hndtxt.ClientID %>').val(textvalue);
$('#<%=add.ClientID %>').click();
},
Close: function () {
$(this).dialog('close');
}
}
});
});
});
</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">
</asp:Button>
<div id="modal_dialog" style="display: none">
<div class="tab_container">
<div id="tab2" class="tab_content">
<table cellspacing="0">
<tbody>
<tr>
<td>
<b>Branch:
<asp:TextBox ID="TextBox2" runat="server" Style="margin-left: 97px"></asp:TextBox>
<asp:label id="lbl_status" runat="server" cssclass="red" text=""></asp:label>
<br />
<br />
</td>
</tr>
</tbody>
</table>
</div>
<!-- end of #tab1 -->
</div>
<!-- ID -->
</div>
protected void btninsert_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(Page.GetType(), "key", "alert('Button Clicked')", true);
}