我使用下面的代码打开窗口(search.aspx)。当我从 btnAdd 单击事件插入记录时,我在 search.aspx 中添加了按钮,然后它会打开另一个窗口。插入记录后,我必须关闭该窗口。我怎样才能做到这一点。
//calling Search.aspx on button click of abc.aspx
if (window.showModalDialog) {
window.showModalDialog("Search.aspx","name",
"dialogWidth:255px;dialogHeight:250px");
}
//Search.aspx code behind
protected void btnAdd_Click(object sender, EventArgs e)
{
//Insert query for adding record
}
//Search.aspx code
$(document).ready(function ()
{
$("input[id$='btnAdd']").live('click', function (e)
{
if ($(".csstablelisttdselected").length == 0)
{
alert("Select patient to fixed appointment.");
return false;
}
else
{
hidPID.value = $('table td.csstablelisttdselected:first').text();
}
});
});
<asp:Button ID="btnAdd" Width="110px" CssClass="cssbutton" runat="server" Text="Add"
OnClick="btnAdd_Click" />