So I decided to update my blog engine to the newest version and along with that I wrote a simple extension to detect IE6 users and redirect them to a non-supported browser page. Not that my theme cannot handle IE6 but I feel I should get on board and help as much as I can with the movement to rid the internet of this outdated browser.
The extension is pretty simple and uses the built in Response.Browser object which should work for IE6 nicely. To make an extension for BlogEngine is pretty easy just create a class with a constructor with no parameters and then wire up one or more events that the BlogEngine raises to your event in your extension class. Below is my extension class for the redirect logic.
[Extension("Redirects users with non-supported browsers to an alternate download page", "1.0", "thefrozencoder.ca")]
public class NonSupportedBrowser
Post.Serving += new EventHandler(ServingHandler);
Page.Serving += new EventHandler(ServingHandler);
void ServingHandler(object sender, ServingEventArgs e)
HttpContext context = HttpContext.Current;
if (context != null && !context.Items.Contains("NonSupportedBrowserTest"))
System.Web.UI.Page page = context.CurrentHandler as System.Web.UI.Page;
if (page != null)
if (context.Request.Browser.MajorVersion <= 6 && context.Request.Browser.Browser.Equals("IE"))
string file = System.Configuration.ConfigurationManager.AppSettings["NonSupportedBrowser"];
As you can see in the constructor I wire up the Page.Serving and Post.Serving events to my own method. I create a context item (NonSupportedBrowserTest) and check for it because the event will be called more than once in the lifetime of the request. I also store the file name in an appSettings key/value so I can change the file to be redirected to (simple HTML file in this case). All that is required is to place the code file in the App_Code\Extensions folder and add the HTML file with the instructions to download a newer browser.
If you are looking for some ideas for this page I simply used the code from the IE6 No More website.
I was able to install Windows 7 Professional (x64) on my Dev laptop today. It didn’t take that long to install and once up and running I had 6 Unknown Devices present in the Device Manager. All I had to do for 4 of them was right click on the device and Update Driver from internet. Windows Update recognized the 4 devices and downloaded drivers for them. This is a list of the drivers that had to be downloaded or installed manually:
Ricoh Memory Stick Host Controller (driver downloaded from windows update)
Ricoh SD/MMC Host Controller (driver downloaded from windows update)
Ricoh xD-Picture Card Controller (driver downloaded from windows update)
AuthenTec Inc. AES2810 (Finger print sensor) (driver downloaded from windows update)
HP Drive Guard Driver (download HP 3D Driveguard (Vista) softpaq sp39410.exe)
Direct Application Launch Button (download HP Quick Launch Buttons (softpaq sp43616.exe))
Once the drivers where updated manually I noticed that I had 4 new Windows Updates to download all of which were the following drivers:
A newer AuthenTec Inc. AES2810 driver
A newer ATI Mobility Radeon HD 3650 driver
A newer Intel(R) 82567LM Gigabit Network Connection driver
A newer Agere Systems HDA Modem driver
All in all a pretty clean and simple install. That probably more so because the the hardware is fairly new.
The only thing that does not work properly is the mute button (part of the quick launch buttons). Not a big deal I will probably just have to update the software when HP updates its library for Win7 in October. Other than I am really liking Win7 so far on this laptop, it runs very well alongside the 8GB of RAM I have installed.
Update: 2009-08-08 - Seems I was wrong about the mute button it does work, however it does not register to Windows that the mute button is enabled so Windows does not display the little red disabled symbol on the speaker icon in the notification area.
Update: 2009-08-29 – I was able to get the AuthenTec Inc. AES2810 finger print reader setup to login to Windows 7 with my fingerprint, it works like a charm. To do this you will need to download the BETA version of the enrolment software here:
The blog site Three Wise Men has a tutorial on how to actually install, setup and enroll your finger print so you can start using this feature.
Update: 2009-10-22 - HP has started to release updated drivers for the 8530p which the new audio driver has fixed my mute button issue listed above. As of todays date (2009-10-22) there are no Windows 7 Professional (x64) drivers. I have installed the Windows Home (x64) drivers and they seem to work as expected. Visit the HP site here.
In some cases there is an issue with installing the following update “Security Update for Microsoft Visual Studio 2008 Service Pack 1 (KB971092)”. The workaround to properly install the update you must set the security on the files vsvars32.bat and vcvarsall.bat to allow the local Users group write permission on those files. I am not sure why this is an issue but from reading other posts and such on the issue most of the affected people do not have vc++ installed.
They can be found in the following folders:
I opened up VS 2008 the other day and noticed that there were multiple instances of the same toolbox item listed (e.g. there were 4 Button controls listed). I tried to reset the Toolbox but nothing seemed to solve the problem.
The fix was to close VS and delete the 4 *.tbd files located @ C:\Documents and Settings\USER_NAME\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ (under XP / Win2k3) or C:\Users\USER_NAME\AppData\Local\Microsoft\VisualStudio\9.0\ (under Vista / Win2k8 / Win7)
Upon restarting VS seems to rebuild these files and fixed the issue. Not sure why this happened and seems nobody else does either.
The following is a couple of T4 templates that I have been fooling around with in my spare time (sharing the time between jQuery, StringTemplate view engine for ASP.NET MVC and other endeavors). For the most part these templates are nothing special, they generate both the T-SQL (stored procedures) and a simple but effective data access layer. Like I said nothing special.
A good resource for starting with T4 templates is @ David Hayden site where he has a Screencast on how to use them. Below describes some of the settings used to get my simple sample up and running.
Extract the _common.tt, DataClass.tt and T-SQL.tt files from the zip and add them to your VS project in a folder (like Generation). In the _common.tt file there are some settings (variables) that you can use to modify how the code is generated. You will need SQL 2005 client tools installed on your machine as it uses the SMO object library. Once the code is compiled just cut and paste it into separate class files and run the T-SQL code on your db.
ConnectionString - This is your connection string to your database
TableName - This is the table you are going to run the code against
SchemaName - Use this for applying a schema to your T-SQL code if you use schemas (default is dbo)
ColumnsToOmit - Comma delimited list of columns to omit from the DAL code that is generated
NameSpace - Namespace of your application
ProcPrefix - Use to add a prefix to your stored procedures (ie. up_)
UseShortProperties - True | False to tell code generation to generate the C# short form for get/set properties
insertColumnsAsGetdate - Comma delimited list of column names that will automatically be assigned the GETDATE() T-SQL statement on an Insert. (Also omits the fields from the insert statement parameters)
updateColumnsAsGetdate - Comma delimited list of column names that will automatically be assigned the GETDATE() T-SQL statement on an Update. (Also omits the fields from the update statement parameters)
The code is supplied as is and if it's broken fix it, you're a programmer aren't you? :P
T4 Templates.zip (4.98 kb)