【问题标题】:Empty Text box conformation <Ok> or <Cancle>.If It is Ok do something else reject the application空文本框确认 <Ok> 或 <Cancel>。如果可以,请执行其他操作拒绝申请
【发布时间】:2016-06-01 06:31:20
【问题描述】:

我在 asp.net Web 应用程序中使用以下消息框。现在我想将此消息框转换为确认消息框,并在它为真时执行某些操作,否则意味着拒绝申请。

ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "confirm('Address,Phone Number,Email ID Is Empty Do You Want To Continue');", true);

【问题讨论】:

  • 这是客户端确认框,因此您必须通过 javascript 在客户端执行此操作。

标签: c# asp.net


【解决方案1】:
<body>

<p>Click the button to display a confirm box.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction()
{
var x;
var r=confirm("Press a button!");
if (r==true)
  {
  x="You pressed OK!";
  }
else
  {
  x="You pressed Cancel!";
  }

}
</script>

</body>

http://www.aspsnippets.com/Articles/Server-Side-Code-Behind-Yes-No-Confirmation-Message-Box-in-ASPNet.aspx

【讨论】:

    猜你喜欢
    • 2023-04-03
    • 2023-03-13
    • 2016-05-30
    • 1970-01-01
    • 2013-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多