Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Logged in username

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nospam - 17 Oct 2007 21:07 GMT
Hello,

I have a Net 2.0 app that uses Forms authentication.
I use a LoginView that contains a Login control to have the user log in.

How do I get the name of the current logged in user?

I wanted to set this from the LoggedIn event fired from the Login submit
button
but it looks like there are some (cookie?) issues which prevent me
from getting this info.  The compiler errors with "not available in current
context".

Anyone have an idea?

thanks,
bruce
Alexey Smirnov - 17 Oct 2007 21:15 GMT
> Hello,
>
> I have a Net 2.0 app that uses Forms authentication.
> I use a LoginView that contains a Login control to have the user log in.
>
> How do I get the name of the current logged in user?

Context.Current.User.Identity.Name
Alexey Smirnov - 17 Oct 2007 21:20 GMT
> Hello,
>
> I have a Net 2.0 app that uses Forms authentication.
> I use a LoginView that contains a Login control to have the user log in.
>
> How do I get the name of the current logged in user?

Context.Current.User.Identity.Name
nospam - 18 Oct 2007 02:28 GMT
Alexey -
Thanks. That worked great.

-bruce

>> Hello,
>>
[quoted text clipped - 4 lines]
>
> Context.Current.User.Identity.Name
nospam - 18 Oct 2007 03:24 GMT
Alexey -

I encountered 1 small problem - after the user logs out, the
Context.Current.Identity.Name
still has the "old" user cached in memory.   Is there a way to reload or
cause a refresh?

Thanks in advance,
bruce

>> Hello,
>>
[quoted text clipped - 4 lines]
>
> Context.Current.User.Identity.Name

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.