Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to get user's Guid id from within BLL

Reply
Thread Tools

how to get user's Guid id from within BLL

 
 
Jeff
Guest
Posts: n/a
 
      04-18-2009
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?


 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      04-18-2009
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

}


"Jeff" <(E-Mail Removed)> wrote in message
news:%23%23%23f9f$(E-Mail Removed).. .
> 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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
DAL or BLL? How to implement objects Nemisis ASP .Net 22 10-17-2006 06:27 PM
BLL and DAL. Roy ASP .Net 10 06-16-2006 08:01 PM
DAL, BLL, does it make sense in a reporting only scenario ? craigkenisston@hotmail.com ASP .Net 4 06-15-2006 03:24 AM
Static Methods in BLL =?Utf-8?B?xZ5lbm9sIEFrYnVsYWs=?= ASP .Net 2 03-18-2005 11:24 AM



Advertisments