July 2006 Blog Posts
Here's a little tip I've just discovered, although it's so simple I'm sure others must be using it. As we all know, IE6 isn't CSS 2 compliant; one feature not supported is the use of selectors. This stops us, for example, from this sort of thing:
input[type="text"] {border:1px solid #000;}
This would mean that only text entry input fields have a black border, while all other entry fields, such as check boxes, remain borderless. A simple way around this problem is to define CSS classes for the style you require and use a theme to set the classes; within the theme you...
In true Earl Stanley Gardner style, I need a hotshot lawyer and detective to help me find some missing error messages. Visual Studio 2005 assures me I have errors, but it doesn't know where they are:
While themes in ASP.NET 2.0 are great, one of the problems is how to have conditional stylesheets for a theme, IE6/7 specific for example; by default ASP.NET loads all stylesheets held within a theme. I've just discovered a great way to do this and it's been out there for a while, but I bet not many people have seen it. I was looking at the ASP.NET Developer Centre Design Templates and downloaded the first one, the Commerce one, which has the greatest solution to the theme/css problem.
This solution has an expression builder in it, one for themes. Expression builders are...
I've been sitting on this project for a while in the vain hope I'd get some time to make it better and loo nicer, but I know that's not ging to happen soon. So, I'm releasing into the wild an ASP.NET 2.0 Web Menu Editor - a Windows Form application that allows editing of SiteMap files. It's fairly simple, with a TreeView to provide the node handling and supports custom attributes and roles. It also supports create of template pages, based upon the SiteMap, using VB/C#, code-inline/code-behind and standard pages/master-content pages. There is plenty more to do, but it's useable...
Another one that came up last week while training. I was explaining the App_Offline file and how it can take the application offline, when someone asked "can it redirect". I'd never thought of this, just never had had the need, but yes it case. Just put a meta refresh tag in (it's an HTML page after all) and the offline file will be displayed, then redirect to your target. Useful if you have a backup site.
This hit me during a training course last week; we've become used to properties of and ASP.NET page being accessed either directly by the property name or preceded with Page.. When using strongly typed master pages though, the two ways of accessing the Master property aren't the same. For example, assume I have a master page with a public property:public string TitleText{get { return TitleLabel.Text; }set { TitleLabel.Text = value; }}In my content page I have: <%@ MasterType TypeName="MasterPage" %@gt;In the content page code, the following works: Master.TitleText = "whatever";While the following doesn't: Page.Master.TitleText = "whatever";You don't...