Access userName asp.net-membership without using Membership.getUser()
While I was working on Membership and User Management in Asp.Net 2010
Following Scenario
I did not want to use getUser function, as I just wanted to get user name of currently logged in user.
To get user name I used following line of code
Following Scenario
- After creating user, admin sets subscribtion for the user.
- User logs in with id and password, after validating user, I check for subscription details.
- If user is logging in with subscription period he/she has access to the application else he/she will be redirected to Subscription Expired page.
I did not want to use getUser function, as I just wanted to get user name of currently logged in user.
To get user name I used following line of code
System.Web.HttpContext.Current.User.Identity.Name
0 comments:
Post a Comment