Web Development

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion


User Login- Windows Identity

By bsmgopal1984 ·
Dear all,
If we have 1000 employees in office,every one having their own user id or employee number.
How can I display their Employee number in ASP page?
When the people open a particular web page which is created by ASP.Net,at the time their page should show their employee number.
This employee number should be displayed based on the user login.
I have used the below code:
WindowsIdentity id=WindowsIdentity.GetCurrent();
But it doesn't working! It shows:NT AUTHORITY\NETWORK SERVICE
How can I get user's employee number in web page?
Please let me know.Thanks in advance

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by lowlands In reply to User Login- Windows Ident ...

You'll also have to make sure to set your webpage (on IIS i assume) to use Windows authentication and not anonymous access for the method you describe above to work.

Collapse -

by robo_dev In reply to User Login- Windows Ident ...

Not sure if this is related to the issue of machines logging in using NETWORK SERVICE instead of ASPNET.

Are you by chance asking for the value of the windows identity object instead of the value of the name property of the object??


accountpropertyDescription += windowsIdentity.Name

Related Discussions

Related Forums