public static Guid UserId()
{
var UserId = new Guid(Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey.ToString());
return UserId;
}
Thanks.......
Please excuse my poor/bad English
***DON'T FORGET TO CLICK “MARK AS ANSWER” ON THE POST IF HELPED YOU.
Marked as answer by webwired72 on Jan 23, 2012 05:02 PM
abiruban
All-Star
16002 Points
2731 Posts
Re: How to reference MVC 3 built-in Account UserId
Jan 23, 2012 03:54 PM|LINK
Hi
use this method
it returns userid
public static Guid UserId() { var UserId = new Guid(Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey.ToString()); return UserId; }***DON'T FORGET TO CLICK “MARK AS ANSWER” ON THE POST IF HELPED YOU.