There is a large difference between a license key and a license agreement. A license key is something used to make it harder to copy software, since you are deploying a web-app, this shouldn't be much of an issue for you. A license agreement is a legal document that users of your application must agree to. I'm guessing you are interested in the first.
In a web application, you should implement a login system, and only provide username/passwords for users who have paid you. If as Kobi mentioned, you have a public API that you'd like to license to other users, I recommend you simply give them a uinque GUID (System.Guid.NewGuid();) and then require that GUID as a parameter for every API call. Then, you can check to see if the GUID is associated with a paid account, if so, let it fly, if not abort the transaction with an error code. I would recommend using an HTTPS connection for this.
If, you are trying to sell your web-application to users, so they can host it on their own server, a license key would be a good idea, you might want to add it as a parameter in <appSettings> under web.config. There are many methods for generating license keys, but in at their most simple they involve generating random numbers until a specific check-sum is met. For example, 1253-38 (1+2 = 3, 5+3 = 8). That is a very simple key that would be easy to crack, but you could come up with a more indepth check-sum if you needed.