Membership.GetUser Issues

N

Nightcrawler

Hi,

I have a blog in my application that any registered user can post to
(I am using Microsoft's Memberships and Profiles for this). When I
show the blog entries in a datalist I also want to show the username
of the registered user that added the entry. My blog table holds the
Guid of the user that added the blog entry so I simply want to retrive
the user information through the UserId Guid.

I found the Membership.GetUser() but it doesn't seem like it supports
retriving user information by the UserId Guid. Does anyone have a nice
and clean way of doing this?

Please help.

Thanks
 
B

Ben Rush

S

spncc

Hi,

I have a blog in my application that any registered user can post to
(I am using Microsoft's Memberships and Profiles for this). When I
show the blog entries in a datalist I also want to show the username
of the registered user that added the entry. My blog table holds the
Guid of the user that added the blog entry so I simply want to retrive
the user information through the UserId Guid.

I found the Membership.GetUser() but it doesn't seem like it supports
retriving user information by the UserId Guid. Does anyone have a nice
and clean way of doing this?

Please help.

Thanks

Do u mean u want HttpContext.Current.User.Identity.Name

for vs 2005 and form authen mode.

ps. comback and say it's rite what u want or not.
 
N

Nightcrawler

Hello.

The Membership.GetUser() method should work for you given that you're using
the default setup for Microsoft's membership and profile services.

http://msdn2.microsoft.com/en-us/library/ms152019.aspx

The documentation linked to from above mentions "associated with the
specified unique identifier." which, in your case, is the GUID. Simply pass
in the GUID.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Ben Rush
Microsoft .NET Consultanthttp://www.ben-rush.net/bloghttp://www.sideshowsystems.com










- Show quoted text -

Thanks! It did work exactly as you said.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top