title: Problem with Membership.GetUser(User.Identity.Name);
body: <p>I put the following algorithm into the login control event. It is fired after the user has logged in. A nuller point exception is thrown.</p>
  
  <p>Answer is updated!! A new exception is thrown, it tells me that cast is not valid</p>
  
  <pre><code>   MembershipUser CurrentUser = Membership.GetUser(Login1.UserName,true);
          int i = (int)CurrentUser.ProviderUserKey;
  </code></pre>
  
  <p>I am assuming that this event is only fired if the user successfully logged in, and not failed.. should i use another event or objects. please help!!!</p>