【发布时间】:2011-05-27 16:34:41
【问题描述】:
当我调用 Roles.GetRolesForUser(); 时使用 asp.net 会员 api它什么也不返回。当我调用 Roles.GetAllRoles() 时,所有角色都会返回。问题是什么?另外,使用会员 api 对用户进行身份验证的正确方法是什么?
【问题讨论】:
-
你在使用 applicationName weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-2200_applicationName_2200-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx
-
它应该返回一个空数组,而不是什么。你确定你使用的是正确的数据库吗?也许是错误的连接字符串?
标签: c# asp.net membership roles