User.IsInRole不工作 [英] User.IsInRole not working
本文介绍了User.IsInRole不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的,
我试图访问User.IsInRole(管理员)。但它总是失败。虽然我在表格中有记录WebPages_Roles和WebPages_UserInRoles。
任何人都可以建议可能是什么问题
问候
Azeem
Dears,
I was trying to access User.IsInRole("Administrator"). But it is always failing. Though i have records in the tables WebPages_Roles and WebPages_UserInRoles.
Any one please suggest what could be the issue
regards
Azeem
推荐答案
但是......你真的创建了用户吗?请记住,必须先创建用户对象,然后才能访问它。您可能已验证用户名和密码但未创建用户。 :)
http:// msdn。 microsoft.com/en-us/library/ftx85f8x.aspx [ ^ ]
这也应该有所帮助...
http://social.msdn.microsoft.com/Forums/en-US / lightswitch / thread / 9bfb3edc-41e7-4126-b316-2fdee3dfdb11 / [ ^ ]
http://msdn.microsoft.com/en-us/library/vstudio/ff851957.aspx [ ^ ]
But ... Did you actually create the User? Remember that you must create a user object before you can access it. You may have validated a username and password but not created a user. :)
http://msdn.microsoft.com/en-us/library/ftx85f8x.aspx[^]
And this should help some too ...
http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/9bfb3edc-41e7-4126-b316-2fdee3dfdb11/[^]
http://msdn.microsoft.com/en-us/library/vstudio/ff851957.aspx[^]
这篇关于User.IsInRole不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文