在 ASP.NET/JQuery/.NET 3.5 环境中,如何显示带有“不再显示此消息”选项的 DIV
,单击时不会显示 DIV
给用户。
我需要在两种不同的场景中执行此操作 - 一种是经过身份验证的用户,另一种是匿名用户。
最佳答案
我用了jquery cookie用于设置 cookie 并在显示对话框之前读取它的插件
示例:有一点奖励功能
if ($.cookie("warned") != "warned"){
display_alert("WARNING: This diallog will not appear again until your next session");
$.cookie('warned', 'warned', { expires: 0 });
}
function display_alert(message,title) {
title = title || "Alert";
$('#alert').text(message);
$("#alert").dialog({
autoOpen: false,
bgiframe: true,
modal: true,
title:title,
buttons: {
OK: function() {
$(this).dialog('close');
}
}
});
$('#alert').dialog('option', 'title', title);
$("#alert").dialog('open');
}
关于asp.net - 如何实现 "Don' t 再次显示此消息”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2465367/