0

I am working on a online website for asp 4.0 I got an problem. I have to display mobile no. and address of a user who have log in. Means from session name i have to match details and fetch from database and display it. But how to do that. Please reply I really need help.

  • Take session id, find appropriate session in database, get this session's related user and take it's phone's number and address – Evgeny Gorbovoy Apr 18 '18 at 15:25
  • 1
    https://stackoverflow.com/questions/263486/how-to-get-the-current-user-in-asp-net-mvc – Evgeny Gorbovoy Apr 18 '18 at 15:26
  • You should try to find a link between the user logged in and the table that stores user details. Try to find a key field that you can "join" on. Otherwise, give us code or the DB layout that you already have put together and we can help troubleshoot your issues, not do your work for you. – Mikanikal Apr 18 '18 at 15:26
  • Do you know, what kind of database you're working with? Do you know how to access the database? Do you know how to execute statements? Do you work with some kind of data access layer? Do you know the table layout? Do you know where the information you need is in those tables? – Corak Apr 18 '18 at 15:27

1 Answers1

0

You can get logged on user name from HttpContext

HttpContext.Current.User.Identity.Name

Prepare a select query to which you will pass the user name you got from above piece of code, apply appropriate filter criteria based on how you are storing user names in your database and fetch selected user details.

Pravin .Kadam
  • 99
  • 1
  • 7