ASPxGridView删除、添加、修改成功后,弹出提示对话框的方法

分为几步:

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"] = "修改成功"; 

猜你喜欢

转载自www.cnblogs.com/qqhfeng/p/8952326.html