Can not get user name from HttpContext.Current.User.Identity.Name
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...how to get the user id of the currently logged in user?
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:
The GetUser method can also take a username as a...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 group name by HttpContext.Current.User?
Is it possible to get the domain user group name or role name on domain server by HttpContext.Current.User?For example, I want to identify if the user belongs to group myDomain/Administrators, I try to use User.IsInRole("myDomain/Administrators"), but I failed.One user maybe join multiple groups. How to get the all groups in code for current user? Demo code for C# and VB please.
Try using this instead:
Note, this will only work if you have ...How can i get the user id of the user currently logged in?
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.
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 Developerhttp://www.dotnetclassic.com
VB:Dim usr as MembershipUser=Membership....Application User and still getting the logged in User Name
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
so do you have anonymous access ON?
try deny anonymous access to your application.
Enable impersonation in your web.config./GuruBhai
By default, ASP.N...How do i get the Name of currently logged in user
i know there is LOGINNAME control to get the name of currently logged in user.. but i want to Display that name in Label Control... is there any Method to get the Name of currently logged in user from LOGINNAME ??[ :O] thanx in Advance
Label1.Text = Page.User.Identity.Name;TalhaMCP, MCADPersonal Site
thank u so much ...Session problem(Previous Users log-in details are getting displayed/withheld for the current user)
we've hosted Bugzilla in windows 2000 server & it has been used by many
users at a given time.we've been getting this peculiar Session problem.ie.If
a user logs-in, the page that he visits contains the details of another user
who has just signed out from bugzilla.Any & all suggestions are welcome.
...getting the current user name that's logged in through the vpn.
I have a question. I was wonder is it possible to get the username of the person that is logged in through the vpn? right now the client uses cisco client to connect to our network. after they are connected the user connects to our citrix server where they input the user name and password for the network.
now then if they go to my website it prompts them again for there user credaintals. I do not want this. I have IIS setup to not allow anonymous access to the page. my web.config file is set to windows authentication.
sounds like a security issue, I'd re-post to the security for...get dotnetnuke current user login name to app in IFrame
I have an application that I would like to use in an iFrame. I currently use the windows authnetication to get the User.Identity.Name, but would like to use the dotnetnuke security login.
Is there any way for me to pass the dotnetnuke security username to a aspx page in an IFrame so then I can do a query against that username.
thanks for any ideas.
figured it out. thanks. this can be deleted
MagicGadget will do this
Pass it as a querystring parameter to the IFrame. Otherwise you need more fancy solutions and I can't help with those :( At least that's the only way I know.-Sean...How to get windows log-in user name using vb.net code?
I built an asp.net web application on our companies HR system so that recruitors can post jobs. Is there a way to get the windows logged in user name using vb.net code?
This user name is using for tracking who posted the job.
Windows Authentication provides some options, as does forms authentication. See if you get what you need through User.Identity.Name. Take a look at:
JeffPlease: Don't forget to click "Mark as Answer" on the p...difference between HttpContext.Current.User.Identity.Name and User.Identity.Name
Q1. what is the difference between
1. HttpContext.Current.User.Identity.Name;and 2. User.Identity.Name
Q2.i'm using asp.net 2.0.
i'm using the following code to authenticate
FormsAuthentication.RedirectFromLoginPage(strEMail, false); Response.Redirect("web/ra.aspx");
my main web.config has
<authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="back.htm" protection="All" &n...Get the User Name for a login user
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...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?
Are you using Active Directory? If so check out this tutorialCommunity Coder
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;
Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed som...