从“确认”框中保护回发 [英] Protecting Postback from Confirm box

查看:60
本文介绍了从“确认”框中保护回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的开发者,



我在按钮onclientclick事件中使用确认弹出窗口打开..



在这个

if(用户在确认弹出窗口中单击确定)

i需要回发帖子,我需要按钮点击事件来执行//工作正常

其他

我不想要回发..我的意思是不应该执行按钮点击事件..//这里也发生回发..





实际上我想在这里避免不必要的回发..有没有可能......



我正在使用C#作为代码...





请做必要的事情...提前谢谢你。 。



问候,

Ganesh kumar K

Dear Developers,

I'm using Confirm Popup open in a button onclientclick event ..

In this
if(the user click ok in confirm popup)
i need the post back to be happened and i need the button click event to perform //Working Fine
else
I don't want the postback .. I mean the button click event should not be performed..//Here also postback happening..


Actually i want to avoid the unwanted postback here.. Is there any possibilities...

I'm using C# as Code behind..


Kindly do the needful... Thank you in advance..

Regards,
Ganesh kumar K

推荐答案

试试这个功能: -



try this function:-

function confirmationMsg()
{
    var answer = confirm("Do you want Reset this page?")
    if (answer){
        document.getElementById('btnName').click();
        return  true;
    }
    else{
        return false;
    }
}





并按下你的按钮



and call on your buttons's

OnClientClick="return confirmationMsg();"


这篇关于从“确认”框中保护回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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