使用java脚本确认消息? [英] confirmation message using java script?

查看:75
本文介绍了使用java脚本确认消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户点击确定按钮,那么数据会在数据库中更新,如果用户点击取消按钮数据未在数据库中更新。

此确认消息用于gridview更新..请帮助我

if user click on OK button then data get updated in database and if user click on cancel button data not updated in database.
this confirmation message for gridview updation..please help me

推荐答案

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


最简单的方法是使用

The simplest way is using
window.confirm(message);



http://www.w3schools.com/jsref/met_win_confirm.asp [ ^ ]

这不是标准的,但在所有浏览器中都实现了。

实际上没有标准 - 但如果你做了一些谷歌(如果window.confirm不适合)你会发现很多解决方案...


http://www.w3schools.com/jsref/met_win_confirm.asp[^]
This is not standard but implemented in all browsers.
In fact there is no standard for this - however if you do some Google (in case that window.confirm not fit) you will find a lot of solutions...


试试这个js函数: -

try this js function:-
function confirmSave() {
    var ans = confirm('Do you want to save this data?');
    if (ans == true) {
        return true;
    }
    else {
        return false;
    }
}





并写



and write

OnClientClick="return confirmSave();"


这篇关于使用java脚本确认消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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