分为几步:
1、在aspx文件中添加
function EndCallBack(s, e) {
if (s.cpAlertMsg != "" && s.cpAlertMsg !=null) {
alert(s.cpAlertMsg);
s.cpAlertMsg = null;
}
}
</script>
//注意,这里的cpAlertMsg,要求必须是小写cp开头,不可修改为其他。
2、在ASPxGridView中添加
<ClientSideEvents EndCallback="function(s, e) {EndCallBack(s,e);}" />
3、在aspx.cs中添加
ASPxGridView1.JSProperties.Remove("cpAlertMsg");//先清空
ASPxGridView1.JSProperties["cpAlertMsg"] = "修改成功";
通过添加以上代码,即可实现弹出提示对话框。
本文详细介绍了如何在 ASPxGridView 中添加特定代码以实现弹出提示对话框的功能,包括在 aspx 文件中添加 JavaScript 函数、在 GridView 控件上设置客户端事件回调以及在 aspx.cs 文件中清空并设置 JS 属性。
1686

被折叠的 条评论
为什么被折叠?



