Tutorial :aspnet Membership login control



Question:

I am building a website that is using the aspnet membership classes. When the user logs in successfully, I redirect them to a myaccount page. In this page I want to load a profile, but I need to know what user is logged in. How would I do this with the aspnet membership stack?

Thanks

Jim Rieck


Solution:1

HttpContext.Current.User.Identity.Name


Solution:2

Once a user is logged in to an ASP.NET Forms authenticated page, you can use the Page.User property to figure out who they are.


Solution:3

Context.User.Identity.Name or Membership.GetUser();


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »