Plip's Weblog

Phil Winstanley - British Microsoft ASP.NET MVP & ASP Insider.

Microformats in .NET

I recently came across Microformats and wanted to create a set of .NET controls which will output Microformat controls.

So this afternoon I made a start and created a hCard and XFN control.

I've applied for a Codeplex workspace called nMicroformats and will upload the code as soon as possible. For now here's a preview: -

<Microformat:hCard
ID="PhilshCard"
runat="server"
Photo="http://static.flickr.com/33/46195571_f9b700742f_m.jpg"
FirstName="Phil"
MiddleName=""
LastName="Winstanley"
Url="http://weblogs.asp.net/plip"
Organization=""
Email="phil@winstanley.name"
Street="91 Billinge Road"
Town="Wigan"
County="Lancashire"
Country="United Kingdom"
Phone="+44 (0) 7753 747 991"
AolInstantMessenger="plipster"
YahooInstantMessenger="plipster"
/>

This produces the following markup: -

<span id="PhilshCard"><div class="vcard">
<img style="float:left; margin-right:4px" src="http://static.flickr.com/33/46195571_f9b700742f_m.jpg" alt="photo" class="photo"/>
<a class="url fn n" href="http://weblogs.asp.net/plip">
<span class="given-name">Phil</span>
<span class="family-name">Winstanley</span>
</a>
<a class="email" href="mailto:phil@winstanley.name">phil@winstanley.name</a>
<div class="adr">
<div class="street-address">91 Billinge Road</div>
<span class="locality">Wigan</span>
<span class="region">Lancashire</span>
<span class="country-name">United Kingdom</span>
</div>
<div class="tel">+44 (0) 7753 747 991</div>
<a class="url" href="aim:goim?screenname=plipster">AIM</a>
<a class="url" href="ymsgr:sendIM?screenname=plipster">YIM</a>
</div>
</span>

Which in turn looks like this: -

Using the Firefox Tails plugin, the markup is picked up and looks like this: -

Comments

peterMarshall said:

Phil Winstanley is trying Microformats, and I looked at this a while ago, I thought there was a lot of...

# September 11, 2006 7:17 AM

Chua Wen Ching said:

Wow. That is cool. Keep me updated :D

# September 11, 2006 9:38 PM

Josh said:

Do you really live there?

How close!

# September 22, 2006 10:16 AM

Luk said:

# February 14, 2007 12:25 AM

steve@veratta said:

One issue with this idea is that Microformats are based on class names, and therefore don't require a specific xhtml element to be rendered. Your method would prevent the modification of elements to suit a user's needs. I too have been looking into creating Microformats server controls, and have thought of perhaps using an enum to allow users to select the element type to render. This would then allow you to output the custom element, with the associated Microformats class name, and allow them to style using CSS.

Thoughts?

# February 14, 2007 4:22 PM

Paul Kinlan said:

Hi,

I have created a project on codeplex for .Net projects that parses microformats from a page.

Check out Release 4 at www.codeplex.com/.../ProjectReleases.aspx

Cheers,

Paul

# September 14, 2007 7:05 AM

AndyEick.com › Plip's Weblog : Microformats in .NET said:

Pingback from  AndyEick.com &rsaquo; Plip&#039;s Weblog : Microformats in .NET

# November 15, 2009 12:49 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)