Forum Moderators: open

Message Too Old, No Replies

Visual Web Developer, accessing data.

Anyone intimately familiar with the server-side goings-ons?

         

cfe_admin

4:24 am on May 17, 2007 (gmt 0)

10+ Year Member



I'm creating a web application using Visual Web Developer Express and have run into a few (seemingly basic) problems. The application takes advantage of some of the built-in Login controls to track any users that log onto the site. This is working fine, and I have it set up to where a user's username is displayed in the sidebar when he/she is logged in.

My one question, what I've been struggling with for some time, is just how to access this username with my own code in a separate file (such as a Page_load function on the master page) once someone has logged in. I know it must be stored as some kind of session data, but I've no idea where. I need to take this username, which is actually more of an id, and run some custom DB queries...

So, to sum up, simple question -> Where the hell do these login controls store the data?

Thanks!

carguy84

6:41 am on May 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HttpContext.Current.User.Identity.Name.ToString()

This will give you the username that they used to log in.