显示和隐藏有关权限的某些控件? [英] show and hide some controls regarding as the permissions ?
本文介绍了显示和隐藏有关权限的某些控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何显示和隐藏有关用户(管理员,普通用户)权限的控件,例如,如果用户是admin,则出现编辑按钮!
Hi,
How I can show and hide some controls regarding as the permissions of the user (admin,normal user) for example if user is admin the edit button appear !
推荐答案
if(!User.IsInRole("Admin"))
{
editBtn.Visible = false;
}
一点常识和大脑活动就可以了.
A little common sense and cerebral activity goes a long way.
这篇关于显示和隐藏有关权限的某些控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文