ASP.NET Forms Auth - Gettings User Data
I'm using forms authentication on a very small ASP.NET web app (Web Forms) in which I want to store additional info about the user in a separate database table.
This is then linked back to the
aspnet_User table and I was figuring the best column to link to is the
UserId column. Problem is I can't work out how to get this piece of data when the user is logged in. Is it even possible?
Also, how do I get the email address?
Before someone points it out, I am aware of the ProfileProvider but the details stored need to be re-submitted each year (it's a registration application for a sporting club) and all previous data stored. So the ProfileProvider isn't really applicable (unless I'm wrong and it can be used to have it stored historically?).
here's how you can get the userid
MembershipUser myObject = Membership.GetUser(); string UserID = myObject.ProviderUserKey.ToString(); string Email = myObject.Email;
- → Function Undefined in Axios promise
- → React formatting dates with momentjs server side
- → AngularJS directive: "templateUrl" doesn't work while "template" works
- → how to add cannonical tag for ASPX .NET page
- → URL routing requires /Home/Page?page=1 instead of /Home/Page/1
- → ASP.NET routing w/ changing article name
- → NumericTextBox Loses Value using Html.TextBoxFor, not HTML
- → How to do Bundling of css & js files in Drupal
- → Does the fact that every page is reachable through www.example.com and www.example.com/index have any SEO impact?
- → How to add rich snippet in a website?
- → UrlRewriting does not work on server, but on localhost it works fine on asp.net?
- → Bootstrap Nav Collapse via Data Attributes Not Working