?
Solved

insert windows username in insert field

Posted on 2007-10-02
9
Medium Priority
?
211 Views
Last Modified: 2010-04-25
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
John
0
Comment
Question by:johnhardy
  • 5
  • 4
9 Comments
 
LVL 4

Expert Comment

by:lrygiel
ID: 19997683
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?
0
 

Author Comment

by:johnhardy
ID: 19997960
I was thinking about the normal windows user accounts
0
 
LVL 4

Accepted Solution

by:
lrygiel earned 2000 total points
ID: 19998052
The code is
<%
      DIM uName
      uName = Request.ServerVariables ("LOGON_USER")
%>

For More info see this article:


http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Microsoft_IIS/Q_22862241.html
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:johnhardy
ID: 19998599
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.
0
 
LVL 4

Expert Comment

by:lrygiel
ID: 19998681
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.
0
 

Author Comment

by:johnhardy
ID: 19999004
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" />
0
 
LVL 4

Expert Comment

by:lrygiel
ID: 19999149
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.
0
 

Author Comment

by:johnhardy
ID: 19999294
Thanks very much for the help and guidance.
All correct
John
0
 
LVL 4

Expert Comment

by:lrygiel
ID: 19999380
Glad I could help.

Lee
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question