Page 1 of 1

userid and roleid

Posted: Mon 12 Feb 2007 21:06
by dooh
Hi,

I have and InsertCommand and UpdateCommand associated to a tableadapter, with a ObjectDataSource, how can i pass by parameters the userid and roleid of the current logged user?

Thanks

Posted: Tue 13 Feb 2007 17:43
by Alexey
UserId can be retrieved as MembershipUser.ProviderUserKey property. As for Role Id, you can use RoleName instead, because it is unique as well.

Posted: Mon 19 Feb 2007 19:39
by dooh
Thanks Alexy,

So, How i now if the user is in role, from current page?

Posted: Tue 20 Feb 2007 06:41
by Alexey
What do you mean by "How i now"? Please describe in detail what exactly you need.

Posted: Wed 21 Feb 2007 18:54
by dooh
Sorry Alexy,

How i know if the user is in the role?

Posted: Fri 23 Feb 2007 07:47
by Alexey

Code: Select all

Roles.IsUserInRole(, );
Why this method doesn't suit?