473,473 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to get user name in a aspx page

Hi All,

I am developing an .net application (intranet). In the Home page, I would
like to show user name (a welcome message) and I don't know how to get the
user name through NT user ID. Will you please help me.

Thanks in advance.
-- Kanth


Nov 15 '05 #1
3 8784
This should work:

Request.ServerVariables["LOGON_USER"].ToString

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Kanth" <ne******@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
Hi All,

I am developing an .net application (intranet). In the Home page, I would
like to show user name (a welcome message) and I don't know how to get the
user name through NT user ID. Will you please help me.

Thanks in advance.
-- Kanth

Nov 15 '05 #2
Hi Jan,

Thanks for your help. But I would like to get user name not the user ID.

Request.ServerVariables["LOGON_USER"].ToString
will return Nt user ID.

Thanks,
- Kanth

"Jan Tielens" <ja*@no.spam.please.leadit.be> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
This should work:

Request.ServerVariables["LOGON_USER"].ToString

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Kanth" <ne******@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
Hi All,

I am developing an .net application (intranet). In the Home page, I would like to show user name (a welcome message) and I don't know how to get the user name through NT user ID. Will you please help me.

Thanks in advance.
-- Kanth


Nov 15 '05 #3
In that case you need to use DirectoryServices and perform a search in
Active Directory for the user with the given logon name. Or, if it's a local
user, get the user information using the WinNT provider (also with the
DirectoryServices library).
Arild

"Kanth" <ne******@hotmail.com> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
Hi Jan,

Thanks for your help. But I would like to get user name not the user ID.

Request.ServerVariables["LOGON_USER"].ToString
will return Nt user ID.

Thanks,
- Kanth

"Jan Tielens" <ja*@no.spam.please.leadit.be> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
This should work:

Request.ServerVariables["LOGON_USER"].ToString

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Kanth" <ne******@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
Hi All,

I am developing an .net application (intranet). In the Home page, I would like to show user name (a welcome message) and I don't know how to get the user name through NT user ID. Will you please help me.

Thanks in advance.
-- Kanth



Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Carl Johansen | last post by:
I'm not sure of the best way to do what I want. Users of my website want to run reports that take a long time to generate. This is what I would like to happen: 1. User requests aspx page 2....
6
by: Tony K | last post by:
I have the most peculiar problem with an ASP.NET page which we use for downloading a file. When the user clicks on a link, the link points to an ASPX page which downloads the file selected. ...
5
by: Michelle Stone | last post by:
Hi everybody I am writing a simple asp.net application using form authentication. I store the list of all users and their passwords in an SQL Server database table. My client recently told me...
8
by: A.M | last post by:
Hi, I know that i can use Page.Request.Path to find what is the current page name. The problem is I can't access to Page object inside a user control. Is there any way that a user control...
5
by: Terry | last post by:
I am developing a asp.net web based service application for our product I am trying to trigger a reboot of the server based on a user request I believe I have all the appropriate code for...
15
by: Tom Nowak | last post by:
I am writing a webapp in which a user is required to enter a login id and password on a login form. I have forms authenticaion coded in my web.config. Once the user is logged in, I want to use the...
2
by: kermit | last post by:
I have a .net aspx page MyPage.aspx (client side) with code behind MyPage.aspx.vb (server side). I use the Page_Load event in MyPage.aspx.vb to load data into a multiteir class based...
3
by: ivanpais | last post by:
Hi, I have a Web User Control, Lets say "Foo.ascx", that contains a button "btnFoo". I have a Master Page "Bar.master", that has a label "lblBar". This label is exposed by a public property...
5
by: moondaddy | last post by:
I have a .net 2.0 winforms app that calls a web service which creates creates a GUID and caches it, then passes the GUID back to the winform. then it opens a aspx page and passes the GUID as a...
5
by: =?Utf-8?B?U2FjaGluIFNha2k=?= | last post by:
I have asp application, from which I am redirecting user to .aspx page. I want to use same sessions in .aspx application. When User clicks on Browsers back button i.e. comes back from .aspx page to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.