Fancy checkbox using CSS only

by John Folley on April 18 2013

Styling checkboxes

Form elements have always been difficult to style up as we want. However thanks to the sibling selector and the checkbox trick, at least the checkbox element is easy to 'style'.

Some solutions attempt to mimick the behaviour of the checkbox using javascript and image replacement. Effectively this involves hiding the checkbox, replacing instead with a fancy checkbox image. Click events are on the image element as well as hover events perhaps to fully mimick the checkbox.

This works, however there are a few issues with this: javascript is required and while most users will have javscript enabled, there's an overhead in the added javascript required. This will be an extra HTTP request, not including the images replaced.

Also, javscript processing and events is quite costly. For a single checkbox on a page, it doesn't matter much but in a table of dozens of rows with one or more checkboxes this starts to slow down the page.

There is however a different solution: using the 'checkbox' hack, we can style checkboxes using CSS only.

Read more... Tags: web-dev

CSS Background Linear Gradients

by John Folley on April 06 2013

As you may know, CSS gradient are becoming more prevalent (and will be more so with IE10 now supporting them ). They're an useful way to have a repeating gradient background without the extra cost of a resource.

Read more... Tags: web-dev

Crafted.Volva: Basic authentication module for IIS7

by John Folley on February 12 2013

Why a basic authentication module for IIS7?

In IIS6, ASP.Net is used more as a plugin to IIS, where requests are passed to the ASP.Net process after going through the IIS process.

In II7, Microsoft introduced the concept of 'integrated pipeline' and 'Classic'. Whereas Classic acts in the same way as IIS6, using 'integrated pipeline' means that requests are handled by ASP.Net directly.

In .Net, different authentication methods use the standard way of setting an authenticated user to the Page using the Principal. This then affects authentication, permissions rules set in web.config.

In IIS6, it is possible to use IIS authentication (basic) to secure a site behind a password, which is useful for test sites. In IIS7 'integrated pipeline', ASP.Net handles all the authentication methods.

This means that you can only set one method of authentication as there can be only one Principal set to the Page. So setting up Basic authentication will cause ASP.Net to consider the user as signed in as with Forms Authentication, which means that secured areas of the website no longer get redirected to a login page using Forms Authentication.

Read more... Tags: web-dev

Crafted.Config: Creating custom configuration sections

by John Folley on February 03 2013

Back in .Net 1.1, creating custom sections in web.config was quite difficult. In .Net Framework 2.0 and greater, this is now a lot easier. However when it comes to accessing text elements or saving values, there are a couple of additional steps.

With this library, the steps to saving a configuration value back to the web.config is made easier.

Read more... Tags: web-dev

Improving Email Deliverability

by John Folley on December 05 2012

At Crafted, we create and manage many sites that send emails to users for a variety of reasons. For example, when a customer buys from a website, the system can be set up to send an email confirming their purchase.

Making sure that these emails end up in users' inboxes, instead of being marked as spam, bouncing, being rejected, or, in a worst case scenario, resulting in the site being blacklisted by ISPs, depends on a number of technical and content-based considerations.

As everyone with an email account knows, email spam is a very real problem; according to the Message Anti-Abuse Working Group, between 88-92% of email messages sent in the first half of 2010 were spam.

With that in mind, it's natural and essential for email providers to screen emails received in order to filter out spam. As senders of legitimate transactional emails, it's also our responsibility to make sure that our emails adhere to industry standards to enable email providers, such as Microsoft, Yahoo and Google, to more easily sort the junk emails from those that have a right to be in inboxes.

Unfortunately, only email providers know their spam filter algorithms, and they like to keep them under wraps. While there are a number of variables that we do know about, no email is ever guaranteed to arrive in someone's inbox.

So, how can you increase the chances of your emails making it to your intended recipients?

Read more... Tags: web-dev