A New Internet Library: Add Your Website/Blog or Suggest A Website/Blog to our Free Web Directory http://anil.myfunda.net.

Its very simple, free and SEO Friendly.
Submit Now....

Thursday, July 24, 2008

Display logged in user details in a DetailsView C#

Hi,

I've implemented a createuserwizard which requires users to enter data into some custom fields stored in a seperate SQL database table from those used in the Membership class. When the user enters their login details the next step of the wizard takes them to a validation screen whereby they confirm the details I am entering into the seperate table are correct and edit them if necessary (by way of a DetailsView).

I'm unsure of how to retrieve the data from the table and insert it into the correct labels i've created in the template DetailsView. I know that the user is logged on so I need to query the table based on the logged on UserID.

The UserID in my custom table is the same as the UserID in the Membership Provider tables aspnet_Membership and aspnet_Users. I think I've found I can get the UserID of the current user with

MembershipUser myObject = Membership.GetUser();

string UserID = myObject.ProviderUserKey.ToString();

What I'm unsure of is how to query my custom table to find this record and then import the fields into my detailsview labels.

Any help would be greatly appreciated.

Thanks



Source Click Here.

No comments:

Post a Comment

Post your comments here:

Originals Enjoy