asp.net - 是/否/全部是/全部否消息框 asp.net

标签 asp.net messagebox confirmation

我想在用户单击我的 aspx 页面中的按钮后显示一个包含 4 个选项的确认框:是/否/全部是/全部否。我看过很多示例,但它只包含是/否选项。请告诉我如何做到这一点。

最佳答案

没有 native JavaScript 函数(我猜您看到了使用 confirm 函数的示例)。

尝试使用 javascript 库来创建伪对话框。

最常用的一个是 JQueryUI 。特别是,看看 the Dialog confirmation sample ,您将以类似以下内容结束:

<script>
  $(function() {
    $( "#dialog-confirm" ).dialog({
      resizable: false,
      height:140,
      modal: true,
      buttons: {
        "Yes": function() {
          // Handler for Yes
        },
        "No": function() {
          // Handler for No
        },
        "Yes to all": function() {
          // Handler for Yes to all
        },
        "No to all": function() {
          // Handler for no to all
        }
      }
    });
  });
  </script>

关于asp.net - 是/否/全部是/全部否消息框 asp.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18073704/

相关文章:

asp.net - Web表单用户控件事件,需要在页面加载后添加

C# 格式化 MessageBox

python - Tkinter 消息框的行为不像模态对话框

c# - 使用 Windows Phone 8.1 后退键按下事件

javascript - Bootstrap 确认: Detect open and close states?

iphone - 如何创建像“设置”-“Safari”-“清除历史记录”中那样的多级弹出提示?

asp.net - Identity.GetUserId() 如何找到用户 ID?

asp.net - 文件夹中的 web.config 允许所有用户身份验证或不进行用户身份验证

javascript - 在Ajax.BeginForm的确认对话框中添加对象routedValue

c# - 在 MVC3 中使用 Server.MapPath