Thanks for the reply Faisal.
I checked both of the links. Both are related to customization in CRM as they are providing solutions for this requirement.
I do not want it inside the CRM but in the .NET code.
Please help me in finding a solution (not MSCRM solution :-)) of this problem.