get user name by user id


i send the user ID to a page and there i wanna find the user name.

can you please let me know how to find a user name by user id?


5/1/2008 5:47:48 PM 27051 articles. 1 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 25

 Are you using Active Directory? If so check out this tutorial

Community Coder
5/1/2008 5:51:22 PM


you can pass the Guid USerId to Membership.GetUser method,

MembershipUser usr = Membership.GetUser(UserIDAsGuid);
string userName = usr.UserName;
// to get the current logged in username , just use  HttpContext.Current.User.Identity.Name; 



Anas Ghanem.

Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks!

5/1/2008 5:58:32 PM

Similar Artilces:

How to get user name and user id from membership cookie
Hello,Is there any way to get the users logged users name and user id from the login cookie? I am using membership class. And also wanted to know if GetUserName() calls the database when ever it is called? thanks for any public static String GetUserName (HttpContext context) {    return context.User.Identity.Name;  } Try this K.Mohamed Faizal Solution Architecthttp://faizal-comeacross.blogspot.comPlease remember to click "Mark as Answer" on this post if it helped you Let say if you want to get Windows username then make sure...

Can not get user name from HttpContext.Current.User.Identity.Name
Hi All; I have tried to use HttpContext.Current.User.Identity.Name to get window user account. However, from debugger, for a long time ago I saw my window user name. But now, I did not see my window user name (from debugger) with the same code and same function call. Please help. Was I doing something wrong? Or any special settings on web.config/machine.config or project to make it work??? I'm stuck Thanks a lot well, you have to have windows integrated authentiction enabled in IIS, IIRC.RTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unre...

Replace user id with user name
Hi, I'm sure this has to be simple but so far I'm having problems finding a solution. I have two data tables: T_Users (id, lname, fname, etc...) T_EventDetails (id, user1, user2, user3, date, etc) These tables are not associated with each other (pk, fk, etc) and are part of a larger system. The "user" fields in T_EventDetails are populated with the "id" data for the various users from a set of DDLs on the main page. The DDLs get their data from the T_Users table (DataValueField="id") and each row in T_EventDetails will h...

get User ID from current user
hi, i'm trying to log database activity. therefore i need the user-id of the currently logged-in user. For the login i used the login-controls that come with VWD and set up a MS SQL Server 2000 Database for data storage. That part works fine, but i've found no way to get the id.i'd be glad for some hints.Thx, SönkeP.S.: found things linke and membershipuser.providerkey (or sth) - but this didn't help me. Are you aware of where the users are stored in the database?  Did you configure the personalization providers from the default?  If not, open up ASPNETDB.MDF a...

Get the User Name for a login user
Hi Guys, How can I get the current loged in UserName in windows in MSSQL? The problem is: Users login into their PC (Windows Login) Enter a URL of the intranet application They would then be able to access the web base application (Intranet) The web application has a string connection to make a connection to the database I want to have a Trigger for my "products" table so if the table is modified (Insert/Update)  all those changes be entered in "products_Audit" table Now on "products_Audit" table I have a field "ChangedBy" where I want to store the windows loged...

Problem in getting logged in user Name for ASPX page with (even with this.User.Identity.Name)
Hi  friends,  I am creating an application that takes current logged in user and displays on the page itself. for this I am getting the user name in PageLoad function by using this.User.Identity.Name and then storing the value in a hidden variable for aspx page. I am using this hidden  variable to display the name of the user. I am using Windows authentication for this. Now problem that I am getting is that when multiple user launch the application from different machine and if they click simultaneously, name of one user appears on the paged displayed on the machine of ot...

how to get the user id of the currently logged in user?
hi,       m develoing a site whereby employees are supposed to log in and take orders.  the users are being created thru the ASP web Administration tool and stored by default into the SQL Server Database named AspNetDB.mdf that's stored in the App_Data folder of our website. the database is created auomatically. How to display the userid as this userid is too complicated and there can be many users with the same username. You can use the Membership class to get the info about a user: Membership.GetUser() The GetUser method can also take a username as a...

Mining of a website to get the user names of its users
Hi, I have to do a application in which we have to trace  a website to get the user name of the uers in that website.Kindly give me idea or code to implement this.                                       Thanking you  If it's your website, I don't see why you would need to do this- you would know from the contents of your users database table. If it's not your own website, this is not c...

How to get user name or user ip address?
Hi to all! I have written a little survey application for our intranet. In order to prevent users from taking the survey a second (3rd, 4th, 5th...) time, the app should detect the user name, or the ip address of the session. Does someone know how to manage this with WebMatrix? Thanks! Bye, MichaelTo finish first, you first have to finish. Sure, you can use the Request object. Request.UserHostAddressStanley Tan theSpoke Blog Stanley, thanks! I searched the MSDN library. I found this article

Getting the user name of the currently logged in user
I'm writing my first custom module. Just as an experimental project I would just display information about the currently logged in user. I can get the User Id, but I don't know where to get the rest of the information. How do I get this? Hi, Just create a new UserController to get the information about one user via the method GetUser(PortalId, UserId) and store it into a UserInfo. Then you can get the rest of the information from this UserInfo [VB] Dim myUser As New UserInfo Dim myUserController As New UserController myUser = myUserController.GetUser(PortalId, Use...

Separting the User name from the Machine name in User.Identity.Name
string userNameWithMachineName = User.Identity.Name; string userNameWithoutMachineName = System.IO.Path.GetFileName(userNameWithMachineName); HighOnCodingWanna get high! ...

How can i get the user id of the user currently logged in?
Hi, I need to get the userId of the user currently logged in. Do I need to use 'user profile' for that? I am using the database schemas installed by the aspnet_regsql.exe. Any suggestions will be very much appreciated. E     Dim user As MembershipUser        user = Membership.GetUser(True)        Label1.Text = user.UserName If this post was useful to you, please mark it as answer. Thank you!Regards.mimranshafiq.NET Web Developer VB:Dim usr as MembershipUser=Membership....

Getting User My.User.Name to use in text box
Hi All,I have a page load event on my opening web page Default.aspx that includes the following code: SearchString = My.User.Name.ToString()when I run the code on my localhost it tells me that SearchString is (lets say) mashfield, my logged on user name.  However, when I i run it on our web server, searchstring returns blank.can anybody explain this?CheersMatt Matt A This means your request is not authenticated. User.Identity.Name is expected to be an empty string if the request is anonymous.If might want to disable the Anonymous access in InetMgr, at the application level. If Window...

Application User and still getting the logged in User Name
Hi I have a very intranet situation where User opens the Web Page Now here is calls a Database table where User Rights are stored But access to this database table is given to dbo and Application Uer which is created in IIS Server folder by clicking on Allow Anomymous Login=true when I try to run the Table Query and pass the USer Name I get null UserName how to deal with this situation   Thanks       so do you have anonymous access ON? try deny anonymous access to your application. Enable impersonation in your web.config./GuruBhai Hi, By default, ASP.N...

Web resources about - get user name by user id -

User:Ram-Man - Wikipedia, the free encyclopedia
This user is interested in many things: preaching , aquariums , woodworking , carpentry , cooking , gardening , computers , and chess . The user ...

Unity (user interface) - Wikipedia, the free encyclopedia
Unity 5.12, with the launcher and the dash displayed, running on Ubuntu 12.04 . Unity is a shell interface for the GNOME desktop environment ...

Just how many users does Apple’s Game Center actually have?
Apple is typically pretty tight lipped about product and user stats and data unless it has a giant number it wants to share. We’re told number ...

Twitter, Instagram Users Want to Be Happier, Healthier in 2016
... year, social media management company Sprinklr has analyzed recent Twitter and Instagram posts to reveal the New Year’s resolution topics users ...

Statistics: Android users were all about phablets this holiday season
It is no secret that smartphones are getting larger. A report published on Medium by analyst Alex Barredo highlights a constant increase in display ...

Christmas definitely brought a lot of new iPhone 6/6s users
... to locate nearby Apple Pay retailers. According to a Twitter update (below), the application saw around a 750 percent increase in new users ...

Microsoft is storing users' sensitive encryption keys in the cloud
Microsoft backs up users' encryption keys to its servers, The Intercept's Micah Lee reports — arguably undermining security protections. Like ...

Snapchat is going to reach a billion users thanks to “Gen-S” — the smartphone generation
Snapchat is going to reach a billion users, challenging Facebook, YouTube, and mainstream media, for the attention of “Gen-S” — the smartphone ...

The 10 Best Movies Of 2015, According To Fandango Users
Animation studio Pixar is well known for pulling at our heartstrings and manipulating our emotions, and rarely has that been on as full a display ...

Ashley Madison hack didn't deter users
A notorious hacking scandal hasn't deterred more than 4 million people from joining cheating website Ashley Madison.

Resources last updated: 12/30/2015 8:08:32 AM