There is lots of exception or error handling in .NET. But if you want to create a custom error exception for your particular code then you can create your own error handling. We need to create a custom exception in our business layer so that the customer cant use the same code in other domain. He can only use that code in particular domain or activation key. You can build you own login to make this work with you activation key. I just show how can you restricted them to you other domain.

So we restricted the user not to use our application other then or containing learneveryday

at first i create a custom exception class DomainValidationException and inherit the System.

Then we make our login process and validate that the Requested url comes from our desire domain.

[smProductImageAdd src=”” alt= “Smart Social Share” href=”″ title=”Smart Social Share ( control)” description=”Smart Social share is a control . Which helps you to give user to share your content with social book mark site.” ref=”marifdu”]

So when the request comes from different domain or other than localhost then it will show this message

You are not allowed to use this code in this domain !, please contact the owner of the code.

Hope this will help you to give security in your application.

You can visit this site for ref :