-8

How to get first name and last name of the user who is logged in asp.net site ? I have to just show the First and Last name in the label on masterpage beside logout button...

Gunner
  • 215
  • 5
  • 15
  • Where do you have the first and last name of the user ? You may store them in a session/cookie after successful login. – Habib Dec 24 '12 at 12:44
  • what do you mean by get first name and last name, are those are present in the data base, and you want to access them based upon the login details? – Raghurocks Dec 24 '12 at 12:46
  • You need to include what auth method you're using (NTLM, Basic) and also what you're using to authenticate (integrated AD, a database, etc...). – bryanmac Dec 24 '12 at 12:50
  • I have to just show the First and Last name in the label on masterpage beside logout button... – Gunner Dec 24 '12 at 12:59

1 Answers1

1

You don't.

Even if you have your site set up so that you need to log in to access it (i.e. file access, not a software login in the website itself), the first name and last name is not required to create a user account, and there isn't even separate field for first namd and last name.

If you have a software login in your site, then you may have let the user enter such information, but then you are the best person to answer your own question, as noone else will know where you have stored the information, or how to access it.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005