如何获得所选确认框的值:

我有以下代码:

string scriptString = "<script language='JavaScript'> ";
scriptString += "confirm ('Are you sure you want to Close this period.')";
scriptString += "</script>";
Response.Write(scriptString);


有没有办法确定您选择是还是否?

最佳答案

var x = confirm('...')
alert(x)


要么

string scriptString = "<script language='JavaScript'> ";
scriptString += "var x = confirm ('Are you sure you want to Close this period.')";
scriptString += "alert(x)";
scriptString += "</script>";
Response.Write(scriptString);

关于c# - 从确认框中获取值(value),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4939598/

10-09 19:47