ASP C# Web Developer default login, getting user ID session value
- by m3n
I've used the built-in wizard in Visual Web Developer 2008 to create a simple login system.
I'd like to get hold of the logged in user's ID, but I'm not sure how. Peeking in the ASPNETDB.MDF in the table aspnet_Users, the column appears to be called "UserId".
I gave it a go:
Response.Write("ID: " + Session["UserId"]);
but it's coming up blank.
How do I do this?
(This is not for a live project, no need to point out the sillyness in using the wizard.)
Thanks