如何在 ASP .NET MVC 5 (C#) 中使用确定或取消选项确认消息框?
How confirm Message Box with OK or Cancel option in ASP .NET MVC 5 (C#)?
我使用 ASP .NET MVC 5。我希望当我在视图中单击退出按钮时显示 Returns OK 或 Cancel 的消息框。我怎样才能做到这一点 ?请帮助我。
这是你想要的吗:
function myFunction() {
var x;
if (confirm("Press a button!") == true) {
x = "You pressed OK!";
} else {
x = "You pressed Cancel!";
}
}
<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Try it</button>
</body>
</html>
我使用 ASP .NET MVC 5。我希望当我在视图中单击退出按钮时显示 Returns OK 或 Cancel 的消息框。我怎样才能做到这一点 ?请帮助我。
这是你想要的吗:
function myFunction() {
var x;
if (confirm("Press a button!") == true) {
x = "You pressed OK!";
} else {
x = "You pressed Cancel!";
}
}
<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Try it</button>
</body>
</html>