title: ASP.NET Getting Current User Name
body: <p>I am trying to build an application on our company's intranet using ASP.NET and VB.NET.</p>
  
  <p>Neither of these functions return anything once my application is published to IIS. They work fine in development (ie: pressing F5 I get my regular network username), but once published they return '' (an empty string).</p>
  
  <pre><code>HttpContext.Current.User.Identity.Name
  Page.User.Identity.Name
  </code></pre>
  
  <p>I'm looking for something -- anything -- that will grab the current users login name. Please note that I CANNOT change these settings in my web.config, because of other functionality requirements.</p>
  
  <pre><code>    &lt;authentication mode="Windows"/&gt;
  
      &lt;roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="AspNetWindowsTokenRoleProvider" cookieName=".ASPXROLES" cookiePath="/" cookieTimeout="480" cookieRequireSSL="false" cookieSlidingExpiration="true" createPersistentCookie="false" cookieProtection="All" /&gt;
  </code></pre>
  
  <p>Nor can I change any IIS settings, to include the 'Enable Anonymous User' setting. Specs are cast in stone and I'd have to chop off my own leg (or head) to get them changed.</p>
  
  <p>I would think there's got to be a way to get the current logged in user's name with my current configuration.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks,</p>
  
  <p>Jason</p>