In this login screen record get inserted into aspnet_membership table of sql server. UserName and password get stored to this table in encrypted form. I want to retrive Userneme each time when user login with his userid and password and get stored into my different master tables. So problem is that how I can retrive UserName from login screen and get stored into another database tables as UserID?
How to retrive userid
I have a login screen like this.

In this login screen record get inserted into aspnet_membership table of sql server. UserName and password get stored to this table in encrypted form. I want to retrive Userneme each time when user login with his userid and password and get stored into my different master tables. So problem is that how I can retrive UserName from login screen and get stored into another database tables as UserID?
In this login screen record get inserted into aspnet_membership table of sql server. UserName and password get stored to this table in encrypted form. I want to retrive Userneme each time when user login with his userid and password and get stored into my different master tables. So problem is that how I can retrive UserName from login screen and get stored into another database tables as UserID?
Alok UniyalPosted Apr 12, 2013, 2:53 AM
Nilesh AvhadPosted Apr 12, 2013, 1:29 AM
Alok UniyalPosted Apr 12, 2013, 12:46 AM
Try this-
For username:
string username = Membership.GetUser().UserName;
For userid:
Guid uid =(Guid) Membership.GetUser().ProviderUserKey;