title: How to get username in global asax?
body: <p>I am trying to check if the user belongs to someone's friendlist from the database and redirect him accordingly.</p>
  
  <p>I am doing this in a routehandler called by Global Asax.</p>
  
  <p>I just want to know how to get the username (from the login information) in the route handler class (or Global asax)</p>
  
  <p>I used this: </p>
  
  <pre><code>string username = HttpContext.Current.User.Identity.Name;  
  </code></pre>
  
  <p>and very strangely, its assigning ".aspx" as the username!! </p>
  
  <p>ps: i did search for similar question but in vain. sorry if I dint search it thoroughly. </p>