【发布时间】:2014-10-19 10:58:12
【问题描述】:
带有条件 Au 自定义命令按钮的 MVC 中的 Kendo UI 网格 如何根据授权有条件地显示销毁或自定义命令按钮
我想在 kendo MVC 网格中为拥有 Role="Admin" 的用户显示自定义命令 喜欢
@if (HttpContext.Current.User.Identity.IsAuthenticated)
{
if (HttpContext.Current.User.IsInRole("Admin"))
{
在我的剑道网格中
@(Html.KendoGrid<Management.Models.Users.UserModel>("dgvUser", "PartialCustomUserModel", false)
.Columns(c => c.Command(cc =>
{
cc.Custom("delete").HtmlAttributes(new
{
@style = @"
color : transparent;
background-position: center center;
background-image: url('../Content/themes/base/images/blue/imgEditUser.png');
background-size: contain;
background-repeat: no-repeat;
height: 28px;
cursor: pointer;"
}).Click("deleteUser");
我能做什么?
【问题讨论】:
标签: asp.net-mvc conditional-statements authorization kendo-grid