如何在asp.net中对警报消息中的“确定"按钮采取措施? [英] how can i give action to ok button in alert message in asp.net?

查看:125
本文介绍了如何在asp.net中对警报消息中的“确定"按钮采取措施?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过在警报消息中使用确定"按钮将另一个网页设置为当前网页?

How can i set another web page to current webpage by using ''ok'' button in alert message?

推荐答案

您无法使用来处理确定按钮事件处理程序.
但是,您仍然可以使用Javascript中的代码来捕获ok按钮的click事件.

这是一个例子-

You cannot handle the ok button by using an event handler.
However, you can still capture the ok button''s click event by using code in Javascript.

Here is an example -

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


这篇关于如何在asp.net中对警报消息中的“确定"按钮采取措施?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆