菜单显示基于角色的autharization [英] menu show on role based autharization

查看:90
本文介绍了菜单显示基于角色的autharization的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

在我的控制器中



 [授权(角色=  用户)] 
public ActionResult 索引()
{
return 查看();
}

}







和我的.cshtml < br $> b $ b









@RenderBody()





如果我触发Index操作然后显示基于角色的菜单





所以请帮助...

解决方案

查看这些文章

ASP.NET MVC应用程序中自定义窗体身份验证的初学者教程 [ ^ ]

自定义角色提供商 [ ^ ]


hey ,
in my controller

[Authorize(Roles = "User")]
   public ActionResult Index()
   {
       return View();
   }

   }




and my .cshtml





@RenderBody()



if i trigger Index action then show the Role based menu


so please help ...

解决方案

Check these articles
A Beginner's Tutorial on Custom Forms Authentication in ASP.NET MVC Application[^]
Custom Role Providers[^]


这篇关于菜单显示基于角色的autharization的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆