asp.net – 是否可以根据用户角色隐藏/显示Kendo网格列?
发布时间:2021-03-31 03:12:49 所属栏目:asp.Net 来源:互联网
导读:我在asp.net MVC中使用Kendo ui网格.是否可以根据用户角色隐藏/显示网格列?谢谢 您可以使用 hidden指定列是否可见,因此一个选项可能是根据用户角色设置变量.例如,在控制器中 ViewBag.CanDisplay = true; // or omit if the user does not have permission 并
我在asp.net MVC中使用Kendo ui网格.是否可以根据用户角色隐藏/显示网格列?谢谢 解决方法您可以使用 hidden指定列是否可见,因此一个选项可能是根据用户角色设置变量.例如,在控制器中ViewBag.CanDisplay = true; // or omit if the user does not have permission 并在视图中 var canDisplay = '@ViewBag.CanDisplay' | false; $("#grid").kendoGrid({ columns: [ { field: "firstProperty" },{ field: "anotherProperty",hidden: !canDisplay } ], (编辑:莱芜站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.NET身份和移动客户端
- asp.net – Jquery Ajax,不在Internet Explorer中工作
- asp.net-mvc – 如何在RegularExpression中忽略大小写?
- 受asp.net MVC启发的更好的WebForms
- .Net平台开发的技术规范与实践精华
- asp.net – IE10中的LinkButtons不执行回发
- asp.net – IIS Express(WebMatrix)打开外部连接
- ASP.NET成员:拒绝用户阻止CSS,页面无法正确呈现?
- asp.net-mvc – 使用Repository/Service Pattern和MVC时缓存
- asp.net+js 实现无刷新上传解析csv文件的代码