【发布时间】:2015-07-03 07:10:17
【问题描述】:
需要帮助如何在 User.Identity.IsAuthenticated 中声明参数?
@if (User.Identity.IsAuthenticated)
{
if (User.Identity.Name == "admin@admin.com")
/*instead of User.Identity.Name, I want to use
if(User.Identity.RoleID = 1)
{
Admin Login Successfull
}
else if(User.Identity.RoleID = 2)
{
User Login Successfull
}
Where to declare parameter "RoleID"*/
}
【问题讨论】:
-
这是一个很好的线程。 [试试这个帖子][1] [1]:stackoverflow.com/questions/18448637/…
标签: c# asp.net asp.net-mvc razor asp.net-mvc-5