ASP.net MVC support for URL’s with hyphens

C# version of John’s Post for anyone who would prefer it: C# and VB version on my blog public class HyphenatedRouteHandler : MvcRouteHandler{ protected override IHttpHandler GetHttpHandler(RequestContext requestContext) { requestContext.RouteData.Values[“controller”] = requestContext.RouteData.Values[“controller”].ToString().Replace(“-“, “_”); requestContext.RouteData.Values[“action”] = requestContext.RouteData.Values[“action”].ToString().Replace(“-“, “_”); return base.GetHttpHandler(requestContext); } } …and the new route: routes.Add( new Route(“{controller}/{action}/{id}”, new RouteValueDictionary( new { controller = “Default”, … Read more

HTML5 i tag validity with icons

Don’t use i. The i element has a meaning which isn’t appropriate for general icons: […] a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another … Read more

Is text-indent: -9999px a bad technique for replacing text with images, and what are the alternatives?

A good reason not to use the -9999px method is that the browser has to draw a 9999px box for each element that this is applied to. Obviously, that potentially creates quite a performance hit, especially if you’re applying it to multiple elements. Alternative methods include this one (from zeldman.com): text-indent: 100%; white-space: nowrap; overflow: … Read more

Google SEO and hidden elements

hide your menu with javascript on pageload. this way google will still analyse your text. it ignores display:none elements, as well as elements which textcolor is the same as background color, thus making it invisible to the human eye sources: i read it in a book a long time ago. there are sites on the … Read more

Can I Use Multiple ItemProps in a Span Tag for schema.org Rich Snippets?

The usual HTML way would be to use one attribute and separate several values with space characters. Looking into the Microdata specification, you’ll notice that this is the case for the itemprop attribute, too: The itemprop attribute, if specified, must have a value that is an unordered set of unique space-separated tokens […] So this … Read more