title: ASP.NET Race Conditions
body: <p>What's the best way to prevent two different people from executing the same method at the same time?  Example, user A is on the same page as user B.  Both press the button on the page at the exact same time executing the code for that event.  I'm trying to make one wait for the other one to finish.</p>
  
  <p>Is there a common way for doing this?</p>
  
  <p>Here's some more info..</p>
  
  <p>This is for a simple game where you buy members of the site (like the Owned game on FB).  The querystring is the ID of the user.  I'm having a problem where two people are clicking buy at the same time.  One gets the user and the other just loses money.  So I'm trying to prevent buying at the exact same time to stop that from happening.</p>