gpt4 book ai didi

javascript - 泰勒瑞克 : preventing postback with RadButton confirm dialog

转载 作者:行者123 更新时间:2023-11-29 09:57:04 26 4
gpt4 key购买 nike

我在执行确认对话框时遇到问题,要求用户确认他的删除选择。如果用户单击取消,RadButton 不应回传到服务器。确认对话框从未显示,我做错了什么?

<script type="text/javascript">
function confirmAspButton(button) {
function aspButtonCallbackFn(arg) {
if (arg) {
__doPostBack(button.name, "");
}
}
radconfirm("Are you sure you want to delete?", aspButtonCallbackFn, 330, 110, null, "Confirm");
}
</script>


<telerik:RadButton
ID="btnDeleteLines"
runat="server"
OnClientClicking="confirmAspButton(this); return false;"
OnClick="btnDeleteLines_Click"
Text="Delete line(s)"
AutoPostBack="false"
GroupName="GroupName1">
</telerik:RadButton>

最佳答案

好的,我找到了the telerik website上描述的方法, CustomRadWindowConfirm

<script type="text/javascript">
//Custom RadWindow Confirm
function CustomRadWindowConfirm(sender, args)
{
//Open the window
$find("<%= confirmWindow.ClientID %>").show();
//Focus the Yes button
$find("<%= btnYes.ClientID %>").focus();
//Cancel the postback
args.set_cancel(true);
}
function YesOrNoClicked(sender, args)
{
var oWnd = $find("<%= confirmWindow.ClientID %>");
oWnd.close();
if (sender.get_text() == "Yes")
{
$find("<%= btnDeleteLines.ClientID %>").click();
}
}
</script>


<telerik:RadButton
ID="btnDeleteLines"
runat="server"
OnClientClicking="CustomRadWindowConfirm"
OnClick="btnDeleteLines_Click"
Text="Delete line(s)"
AutoPostBack="false"
GroupName="GroupName1">
</telerik:RadButton>

关于javascript - 泰勒瑞克 : preventing postback with RadButton confirm dialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9772670/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com