在按钮单击中删除之前来自用户的确认消息 [英] Conformation message from the user before deleting in the button click

查看:91
本文介绍了在按钮单击中删除之前来自用户的确认消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个java脚本,显示来自用户的构造消息框。

脚本在这里



I Have a java script which shows the conformation message box from the user.
script is here

function OnClientClicked_CheckConfirm(button, args) 
{
    var objhidConfirmMessage = document.getElementById(hidConfirmMessage);
    var objhidConfirmOKBtnText = document.getElementById(hidConfirmOKBtnText);
    var objhidConfirmCANCELBtnText = document.getElementById(hidConfirmCANCELBtnText);
    if (objhidConfirmMessage != null) 
    {
        button.set_autoPostBack(false);
        jConfirm(objhidConfirmMessage.value, 'Confirmation Dialog', objhidConfirmOKBtnText.value, objhidConfirmCANCELBtnText.value, function (r) {
            if (r) {
                __doPostBack("tlkBtnQuickFormatCaptureDrive", "OntlkBtnQuickFormatCaptureDrive_Click");
                blnConfirm = true;
            }
        });
    }





我的问题是这里java脚本在点击是我需要做按钮点击事件后工作,它在_doPostBack(tlkBtnQuickFormatCaptureDrive,OntlkBtnQuickFormatCaptureDrive_Click)上面的脚本中没有工作



;我做错了。



My problem is here the java script is working after clicking the yes i need to do button click event, it is not working

in the script above _doPostBack("tlkBtnQuickFormatCaptureDrive", "OntlkBtnQuickFormatCaptureDrive_Click"); am I doing any wrong.

推荐答案

只需在按钮定义中添加以下行即可完成。无需添加额外代码。



Simply add below line in your button definition and you are done.No need to add extra code.

OnClientClick="return confirm('Are you sure you want to delete selected records?');"





如果你单击是,那么只会执行OnClick事件。



问候......:笑:



if you click yes,then only OnClick event will be executed.

Regards.. :laugh:


这篇关于在按钮单击中删除之前来自用户的确认消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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