title: sharepoint new form get Domain\Username from people picker
body: <p>I have a PeoplePicker field in my Newform.aspx where I want to pick Domain\Username of that particular field and update in another field.</p>
  
  <p>I think there is some issue while using as below:</p>
  
  <pre><code>strUser = properties.AfterProperties["PeoplePicker"].ToString();
  web.AllowUnsafeUpdates = true;
  
  SPUser spUser = web.EnsureUser(strUser);
  spUser = spUser.LoginName; \\This returns Domain\Username
  
  if (properties.AfterProperties["PeoplePicker"] != null)
  {
    properties.AfterProperties["AnotherField"] = spUser;
  }
  </code></pre>