I recently read about the First Chance Exception and thought it was quite an interesting. While First Chance Expection helps during debug, for a production scenario we normally need to rely on catching errors using try catch. In a recent WCF project I tried implementing a GlobalErrorHandler and believe me it works like Magic. It […]
C#
jQuery DataTables – Async and Responsive
I have used jQuery Datatables in a few MVC projects with Bootstrap and find it pretty easy to integrate. It allows data to loaded via ajax and can be made responsive. It has inbuilt UI features for sorting, pagination and search features. Here is an easy implementation sample.
Multithreading with a loop using Parallel
In a recent project I had to work with some API calls that allowed only one record at a time. To finish 53000 records took the application more than 7 hours!! damn that sounded like 80s to me. I had to go the multithread way to finish the tasks in acceptable time. The immediate challenge […]
Configuration based Unity IOC for Dependency Injection
I have always maintained that having an IOC for DI makes only half sense if we are still registering the types in the code. The exception is when you have dynamic parameters passed into constructors of the classes being constructed by the Dependency Injection. Here is what I mean for example instead of doing […]
HttpHandler to handle image uploads at server
The following module is useful to handle image uploads at the server especially when not using the default upload controls. It can be affectively used for hanlding ajax image uploads. The following handler returns Html content(true or false) based on the result of the upload. public class Upload : IHttpHandler { public void ProcessRequest(HttpContext […]
Dynamic resizing of Images
Front end users are free to upload images of any size, However for uniformity its often necessary to resize these images to a standard width and height but still maintaining the aspect ratio. The following function is what I use to to resize an image dynamically. The file thus returned can then be renamed and […]