userid and roleid

userid and roleid

Postby dooh » Mon 12 Feb 2007 21:06

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
dooh
 
Posts: 30
Joined: Sun 14 Jan 2007 21:11

Postby Alexey » Tue 13 Feb 2007 17:43

UserId can be retrieved as MembershipUser.ProviderUserKey property. As for Role Id, you can use RoleName instead, because it is unique as well.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby dooh » Mon 19 Feb 2007 19:39

Thanks Alexy,

So, How i now if the user is in role, from current page?
dooh
 
Posts: 30
Joined: Sun 14 Jan 2007 21:11

Postby Alexey » Tue 20 Feb 2007 06:41

What do you mean by "How i now"? Please describe in detail what exactly you need.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby dooh » Wed 21 Feb 2007 18:54

Sorry Alexy,

How i know if the user is in the role?
dooh
 
Posts: 30
Joined: Sun 14 Jan 2007 21:11

Postby Alexey » Fri 23 Feb 2007 07:47

Code: Select all
Roles.IsUserInRole(, );
Why this method doesn't suit?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL