我下面的代码工作正常,除非单击“继续”按钮时它不会发送 true 值。
<script type="text/javascript">
function EmpDelete(f_name) {
$("#fName").text(f_name);
$('#dialog').dialog({
title: "Delete Employee?",
modal: true,
width: 500,
height: 250,
buttons: {
"Cancel": function () {
$(this).dialog("close");
},
"Continue": function () {
$(this).dialog("close");
// return true;
}
}
});
return false;
};
</script>
当单击 imgDelete ImageButton 时,将调用上述 jQuery 事件。
e.Row.Cells[iDelete].Controls.Add
(new ImageButton
{
ImageUrl = "Images/database_delete.png",
CommandArgument = e.Row.RowIndex.ToString(),
CommandName = "Delete",
ID = "imgDelete",
CssClass = "imgDelete",
OnClientClick = "return EmpDelete('" + e.Row.Cells[iFNmae].Text + "');",
ClientIDMode = System.Web.UI.ClientIDMode.Static
});
如何使 jQuery 上的“继续”按钮返回 true 值,以便我的“RowCommend”事件可以进行进一步的处理?
protected void gv_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
}
}