Master page:javascript
<script src="../js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="../js/hideshow.js" type="text/javascript"></script>
<script src="../js/jquery.tablesorter.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/jquery.equalHeight.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".tablesorter").tablesorter();
}
);
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$("[id*=btnadd]").live("click", function () {
debugger;
$("#modal_dialog").dialog({
title: "Manage Branch",
autoopen: false,
width: 500,
buttons: {
ADD: function () {
$("[id*=add]").click();
},
Cancel: function () {
$(this).dialog('close');
}
},
modal: true
});
return false;
});
</script>
popup calling:
<div id="modal_dialog" style="display: none">
<div class="tab_container">
<div id="tab2" class="tab_content">
<table class="tablesorter" cellspacing="0">
<tbody>
<tr>
<td>
<b>ID:
<asp:TextBox ID="TextBox1" runat="server" Style="margin-left: 130px"></asp:TextBox>
<br />
<br />
Branch:
<asp:TextBox ID="TextBox2" runat="server" Style="margin-left: 97px"></asp:TextBox>
<br />
<br />
</td>
</tr>
</tbody>
<asp:Button ID="add" runat="server" Text="ADD" style="display:none" OnClick="btninsert_Click"></asp:Button>
</table>
</div>
<!-- end of #tab1 -->
</div>
<!-- ID -->
</div>
Backend calling function
protected void btninsert_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=WINCTRL-TNT3FMR;Initial Catalog=TaxiAPP;Integrated Security=True";
SqlCommand command = new SqlCommand("Insert into Branch(ID,Branch)values(@ID,@Branch)SELECT SCOPE_IDENTITY()", con);
con.Open();
command.Parameters.AddWithValue("@ID", TextBox1.Text);
command.Parameters.AddWithValue("@Branch", TextBox2.Text);
command.ExecuteNonQuery();
con.Close();
}