Mask a Phone Number Field but Only Save the Numbers using jQuery

Masking a phone number field is relatively easy by utilizing one of the many jQuery masking plug-ins. It will turn your input field from this: 5554449999 into this: (555) 444-9999 which looks much nicer but at the same time that becomes the text that will be sent when you post back the form to the server.

Continue reading

Restrict Access to an MVC Action or Controller by IP Address using a Custom Action Filter

Scenario: You want to lock down access to a particular action or entire controller in your MVC application via the users IP address.  This can be particularly useful if you would like to restrict the Admin portion of your website to just your company’s IP address range.

There are several ways to accomplish this task. IIS allows you to restrict by IP Address but what if you want to do it programmatically…

Continue reading