是/否/是全部/否所有消息框asp.net

时间:2013-08-06 07:05:26

标签: asp.net messagebox confirmation

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

1 个答案:

答案 0 :(得分:3)

没有原生的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>