【发布时间】:2018-11-28 17:39:30
【问题描述】:
我有一个数据网格“AWGrid”,它有 EditCommandColumn 并删除 Templatecolumn。
当页面加载时,我正在检查用户权限,如果用户没有适当的角色,它应该只能查看内容并且应该禁用编辑和删除按钮。目前,我在每个事件上禁用这些按钮,当它们被点击时。
if (!wrp.PageAuthenticationForUser(currPage))
{
e.Item.Cells[0].Enabled = false;
return;
}
我想禁用页面加载本身的那些按钮。像这样的
if (!wrp.PageAuthenticationForUser(currPage))
{
txtLbl.Text = "You are Not Authorized to do perform operation setup.";
//AWGrid.ReadOny = true;
}
但这似乎不起作用。有没有一种简单的方法来实现这一点。
提前致谢。
【问题讨论】:
标签: c# asp.net asp.net-mvc-4 datagrid