Monthly Archives: August 2014

Minify Css using C#

Here I am sharing a simple code to minify css to optimize the size and make the page load faster. Long css files are always a headache when comes to the page load speed. This will fix that issue for an extent

Happy Coding

Calculate age of a person from his date of birth

When I was working with a project, I wanted to calculate age using date of birth provided. So I implemented a method and made it an extension to datetime object. I am sharing this code with you guys

Happy Coding

Create a month dropdown list easily

Here I am introducing a useful extension method for Dropdownlist in and C#. Creating Month list in a dropdown list.

Simple, easy and clean. Happy Coding

How to get Start Date and End Date of Current Month in SQL

Here I am sharing a simple technique to get start date and end date of current month in sql.

You can replace getdate() with any date to find the first and last date of that month.

How to limit input control to accept only numeric or alpha numeric

Often it is a pain in the neck to validate text boxes for invalid characters. In some cases we expect only numbers, in some cases alpha numeric. It is easy to fix this issue with jquery

Add this snippet your js file or page. Make sure you referenced jquery. Now simple use the class “alphanumericOnly” for the text boxes for alpha numeric, and “numericOnly” class for text boxes which expects numeric only.