Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 31, 2013 01:21 AM by Decker Dong - MSFT
Jan 25, 2013 04:42 PM|LINK
Hello dear all!
I am currently working on "My information" page for the users. I am using VS's own create user wizard and its own database. But I am confused to get inofrmation of the user that is logged in. My database's name is(aspnetdb.mdf) and I have an sqldatasource
(called sqldatasource1). Now what I want datasource to do is retreiving the data of the user that is logged in. For example My user name is "Admin". When I open "My information Page" datasource will retrieve the informiaton where column username(in the DB)
equals "Admin"(the username). How can I do that. I tried some codes but they didn't work. WHen I write them gridview comes empty. I tried (User.IDentity.Name) But it didn't work.
I am waiting for your answers
Jan 25, 2013 10:06 PM|LINK
Seems like you need to setup the ASP.NET Membership roles/providers.
Do you want users to create, login and view pages?
If so, then read this:http://weblogs.asp.net/scottgu/archive/2006/05/07/ASP.NET-2.0-Membership-and-Roles-Tutorial-Series.aspx
You can create your own "users" table/objects, but Microsoft has it built in already.
Jan 27, 2013 06:28 AM|LINK
First of all thank you for your answer. The artciles are really great but unfortunately ı couldn't find my answer :( In admin page I can get user's info. that's okay. But plus that I want users to see their own information in a page.
Jan 31, 2013 01:21 AM|LINK
But plus that I want users to see their own information in a page.
Just use the specific user's Info such as ID to query out all the info from the user and use output to page.