抱歉,如果我的英语很差。
我有一个问题,我认为问题是我对 javascript 的了解不够,但是..我知道你可以帮助我解决这个问题。
我有一个带有图像按钮的页面,我用它来删除数据,并且我需要一个确认对话框。 Alertify 很漂亮,我在服务器端使用 altertify 警报,如下所示:
string myScript2 = "alertify.error('message.')";
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(),
Guid.NewGuid().ToString(), myScript2, true);
return;
并且工作正常!
但我不明白如何使用alertify.confirm。
例如我用过
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../../js/alertify.min.js"></script>
<!-- include the core styles -->
<link rel="stylesheet" href="../../js/alertify.core.css" />
<!-- include a theme, can be included into the core instead of 2 separate files -->
<link rel="stylesheet" href="../../js/alertify.default.css" />
<script type="text/javascript">
$("#btElimina").on('click', function () {
alertify.confirm("This is a confirm dialog", function (e) {
if (e) {
alertify.success("You've clicked OK");
} else {
alertify.error("You've clicked Cancel");
}
});
return false;
});
</script>
但没什么可做的...我不能使用 onclientclick 因为alertify是一个非阻塞而不是模态窗口... 你能帮我理解吗?不是为了我写代码,而是为了理解我并使我可行 谢谢
亨利
最佳答案
将 alertify.success("You've clicked OK");
替换为 return true;
和 alertify.error("You've clicked Cancel");
with return false;
同时更改此:
$("#btElimina").on('click', function () {
对此:
$("#<%=btElimina.ClientID%>").on('click', return function () {
关于c# - 在 asp.net C# 页面中提醒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19701706/