Link to home
Create AccountLog in
Avatar of johnhardy
johnhardyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

insert windows username in insert field

I am using asp in windows XP and have a insert field for the username.
Is there a way I can get the name of the windows account holder name to appear in the username text field.
many thanks
Avatar of lrygiel
Flag of United States of America image

Where is the account holder's name stored? Are you using a site with anonymous access or does the user have to sign in. If the user signs in, how is it being validated? By you or Windows?
Avatar of johnhardy


I was thinking about the normal windows user accounts
Avatar of lrygiel
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks very much for that
At the moment I have an empty textfield
<input type="text" name="InvestmentEntBy" value="" size="32" />
Can you please advise me where I please the code.
Place <%Request.ServerVariables ("LOGON_USER")%> between the quotes of value="". See below.

<input type="text" name="InvestmentEntBy" value="<%=Request.ServerVariables ("LOGON_USER")%>
 " size="32" />

If they are logged into Windows, there username (logon name) wil be inserted into the value of the textbox.
Thanks,  I think I have it correct but the box remains empty
            <td colspan="3" valign="top"><input type="text" name="InvestmentEntBy" value="<%=Request.ServerVariables ("LOGON_USER")%>" size="32" />
In order for this to work, you need to make sure that:

   1) anonymous access is turned off for the web site and
   2) Integrated Windows authentication is turned on.

Both of these can be accomlished from Web Properties, SECURITY tab found under the IIS server application control panel.
Thanks very much for the help and guidance.
All correct
Glad I could help.