Blogs

Url ReWriting on Windows and IIS

Those of us who have used Apache on a Unix platform are familiar with Apache Mod Rewrite, which allows urls to be rewritten using rules and regular expressions. This allows for “pretty urls” instead of long querystring urls that aren’t particularly user or search engine friendly.

A url such as

/index.aspx?type=blog&category=programming 

can be rewritten to something like

/blog/programming/

Much easier to read and remember.

Custom Error/Exception Handling on ASP.Net applications

I found a great article on unhandled exception management.

http://aspnetresources.com/articles/CustomErrorPages.aspx

This is the best overview i've found of how to implement secure error handling, with solid examples.

Slideshows, tickers and dynamic content rotation and cycling with JQuery plug-ins

Advances in browsers and JavaScript have allowed for some very nice text and image effects to be done without using additional software such as Flash, Silverlight or Java. One of the biggest advantages of this technique is that all the images and text are displayed in the source code, so search engines can find all the content. Also, you don’t have to buy any new software to develop a solution. This also allows for keeping more content in compact spaces.

ASP.Net Captcha Control

Our clients started to receive spam from their contact forms and wanted to curb it. I looked for a free(clients love “free”) captcha control for ASP.net, and found the following solutions

Free Captcha control:

This is the solution I like the best. Just download the source and build the solution, include the dll in your /Bin folder

CodeProject Article and Download

Viewing your application with the templates intact – local IIS

I often have to integrate applications into pure html websites, maintained with a content creation system. I usually throw the application into a separate folder, and make that folder an application in IIS. I then create a master-page and throw their site’s template in it.

The problem I was having was managing paths to css and images within the template when developing the application using the local file system. I wanted to use all their image resources and the existing scripts and CSS and view all these together when I was developing.

Getting your CSS to look the same in all browsers – Base CSS / CSS Reset

Because browsers, even standards compliant ones, interpret web standards differently and/or have different defaults for margins/padding/default font sizes, it is often good to have a baseline set of CSS styles that “reset” everything to common values. These style sheets are often called “Reset” or “Base” CSS.

Localization and Dates – Preventing Mismatches

Some of the servers I work on are in the U.S., but I work from Canada and have my PC set to locale en-CA. This locale inverts the month and day in the short date string. For example May 1st 2009 would be written as 5/1/2009 in the US, 1/5/2009 in Canada, as per the locale. SQL Server is usually setup as US as the locale for storing dates regardless of where the server is.

Connection Strings

One of the SQL servers I help maintain was being “brute-force” attacked. We decided to change the default port for SQL Server, close that port down on the firewall,  which basically solved our problem, while maintaining the flexibility we needed for distributed development of the applications.

I had to go through and change all our connection strings for our applications. We had recently changed to SQL 2005, and I wasn’t sure how to take into account custom ports.

FtpVC - Version Control over FTP

For the last couple of years, I’ve been working with another developer on one project. Once we started working in the same space, of course we started to overwrite each others work. I work from Montreal, Quebec and he works from New Brunswick. We needed a good solution for checking in/out files that was inexpensive and with minimal setup and expertise required. I also wanted to be able to publish the changes immediately, not having to keep to sets of data, updating the version control, then updating the production server.

Blank XHTML/CSS Layout Templates

I find it very useful to have a blank layout template to start with. I used to do this with tables. Now with CSS you can do a nice layout with a lot less mark-up.

However, I found it hard to create the classic templates that are used for the majority of sites. This was especially true for the classic “C” template(or variations thereof):

Syndicate content