protected void btnSumbit_Click(object sender, ImageClickEventArgs e) { try { bool isSucc = true; //新建 if (this.btnSumbit.ImageUrl.IndexOf("imgNew1.gif") != -1) { isSucc = RoleEditControl1.AddNewRole(); RoleEditControl1.ClearUI(); } else//修改 { isSucc = RoleEditControl1.UpdateRole(); RoleEditControl1.ClearUI(); this.btnSumbit.ImageUrl = "../../images/icon/imgNew1.gif"; } if (isSucc == false) { this.HidNewRole.Value = "block"; } else { this.HidNewRole.Value = "none"; } BindRoles(); } catch { this.PrintfError("数据访问失败!"); return; } }