【发布时间】:2015-10-03 06:45:35
【问题描述】:
我正在 asp.net 中开发 Web 应用程序。我的要求是在每个按钮单击事件上显示确认消息,例如(插入、更新和删除按钮)。我在整个应用程序中使用 jQuery 消息框成功插入、更新和删除。
function MessageBox(Title, InnerText) {
try {
var dialog = $('<p class="messagebox">' + InnerText + '</p>').dialog({
title: Title,
width: "240",
modal: true,
buttons: {
"OK": function () {
dialog.dialog('close');
}
}
});
}
catch (e) {
MessageBox('Tracker Alert', e);
}
}
调用按钮点击事件
Result = Save_UpdateData(2);
if (Result > 0)
{
ScriptManager.RegisterStartupScript(this, GetType(), "msg", "MessageBox('Tracker Alert', 'Record updated succesfully');", true);
}
那么,如何使用与上述功能相同的jQuery消息框在按钮单击事件上显示确认消息?
【问题讨论】: