gpt4 book ai didi

javascript - Telerik RadConfirm 不适用于 asp.net 的 UserControls

转载 作者:行者123 更新时间:2023-12-03 06:07:57 26 4
gpt4 key购买 nike

在取消选中 asp.net CheckedChanged 事件时,我从 UserControl 的服务器端调用 Telerik 的 RadConfirm。 UserControl 在 ASP.NET 网页中重复多次

如果未选中,那么我将抛出错误消息

radWindowManager.RadConfirm("Are you sure you want to clear controls?", "confirmCallBackFn", 300, 100, null, "");

如果参数为真,那么我将清除并禁用所有相关控件

当我单击第一个 UserControl 的复选框时,它会为最后一个 UserControl 触发。它始终为最后一个用户控件工作。下面是它的脚本

function confirmCallBackFn(arg)
{
if (arg == true)
{
$find('<%= FindControl("txtAmount").ClientID %>').disable();
}
}

最佳答案

使每个用户控件实例的回调函数名称都是唯一的,否则最后一个实例将覆盖其他实例:http://www.telerik.com/support/kb/aspnet-ajax/details/using-dynamic-unique-names-for-javascript-functions .

radWindowManager.RadConfirm("Are you sure you want to clear controls?", 
"confirmCallBackFn" + this.ClientID,
300, 100, null, "");

function confirmCallBackFn<%=this.ClientID%>(arg) {

关于javascript - Telerik RadConfirm 不适用于 asp.net 的 UserControls,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39451236/

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