ASP C# Web Developer default login, getting user ID session value
Posted
by m3n
on Stack Overflow
See other posts from Stack Overflow
or by m3n
Published on 2010-05-22T19:12:58Z
Indexed on
2010/05/22
19:20 UTC
Read the original article
Hit count: 493
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
© Stack Overflow or respective owner