This small function deletes a folder and all its contents from specified location on the server. This code is very handy as in ASP.NET you can not directly delete a folder if it is not empty. Therefore this code first delets all the content files and then removes the folder. Recursive call ensures the deletion of all the sub folders too.
ASP.NET: Delete A Directory In ASP.NET
Important: Please ensure that the folder is given poper rights for local machine's ASP.NET Machine Account.