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 www.learneveryday.net 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=”http://learneveryday.net/codecanyon/adverticement/add_codecnayon_smart-social-share-asp.net.png” alt= “Smart Social Share” href=”http://codecanyon.net/item/smart-social-share/160097″ title=”Smart Social Share (Asp.net control)” description=”Smart Social share is a asp.net 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 : http://www.geekpedia.com/tutorial80_Creating-custom-exceptions.html