Today I installed Visual Web Developer 2010 express and started making a website without any previous ASP experience.
After combining information from 2 books and Microsoft I finally managed to setup a simple site which uses "Forms" authentication and displays info from an Sql Express database.
Now the question is how do I "link" information from the database to the User IPrincipal (I don't know what IPrincipal is, just saw the definition in VS). If user successfully logs in then I display his User.Identity.Name in default.aspx. In my demo database the user has an ID field which I need to use in order to retrieve his personal data. Of course I can always execute a select of the kind:
"select firstname, surname from testdatatable , webuserstable
where testdatatable.id = webuserstable.personid and webuserstable.username = " + User.Identity.Name
I would like to avoid that and somehow permanently store the user id in the User "variable" or anywhere that it would be globally/easily available to all the pages.
Thank you in advance
View Complete Post