how to get user's Guid id from within BLL

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 2.0

I'm wondering if it's possible to get the Guid id for user from within the
BLL/DAL.. that is other pages than .aspx.cs...

I know I can get the current username from within BLL using this code:
HttpContext.Current.User.Identity.Name;

I ask cause in my code I want the Guid as it's a foreign key in database...
I have a table which is connected to aspnet_users, so when creating a new
record in that table, then I need the foreign key to the aspnet_users
table...

any ideas?
 
You can pass the context down to the BLL if need be.


OR


If you're in the BLL....its "available".

Try this code in your BLL

if ( null == System.Web.HttpContext.Current ) // Add a reference to
System.Web.dll
{ //Non Web Environment
}
else
{ //Web Environment

}
 
Back
Top