title: Get current sharepoint user id inside a web part
body: <p>I am trying to access the currently logged in user when an event fires in a web part. I would typically think to do this with:</p>
  
  <pre><code>SPContext.Current.Web.CurrentUser
  </code></pre>
  
  <p>and specifically, to get the ID (what I need):</p>
  
  <pre><code>SPContext.Current.Web.CurrentUser.ID
  </code></pre>
  
  <p>This works as expected in say an event receiver. However, in my example web part, this is returning information about the machine user account. How would I best access the logged in SharePount user instead?</p>