Welcome to MSDN Blogs Sign in | Join | Help

Simple Silverlight SEO with ASP.Net and XSLT

A common practice with Rich Interactive Applications (RIAs) is to expose the text as hidden DIV section in on the same page as the Silverlight control.  I have crafted a page with a Silverlight application that has a unique word on it that is picked up by Google's search engine.  When search crawlers see the page, they don't see the Silverlight XAML but they do see the XHTML that is generated by transforming the XAML into XHTML.  Using the ASP.Net <asp:Xml> element and specifying an XSL Transformation that does this translation:

<div id="SLHost">

    <asp:Xml ID="XHTML" runat="server" DocumentSource="seo.xaml" TransformSource="XAML2XHTML.xslt" EnableViewState="False"/>

    <script type="text/javascript">

        createSilverlight();

    </script>

</div>

Try using this technique for your Silverlight applications running ASP.Net.  Here is how the content is transformed:

  • <Canvas> elements are turned into <div> tags
  • <TextElement> elements are turned into <div> tags with the text inside
  • <Run> elements are turned into <span> tags
  • <Image> elements are turned into <img> tags
  • <MediElement> elements are turned into <a href> hyperlinks.

It doesn't produce pretty XHTML but search engines don't care about that.  take a look at the XSLT transform and see how simple it actually is.  Using this technique, when the XAML changes, the plain-text XHTML content changes as well.

Published Wednesday, October 03, 2007 12:20 PM by Michael S. Scherotter
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Techy News Blog &raquo; Simple Silverlight SEO with ASP.Net and XSLT

# Other Silverlight SEO Techniques

The technique described in my previous post will work for Silverlight solutions that generate XAML on

Thursday, October 04, 2007 12:03 AM by Synergist

# re: Simple Silverlight SEO with ASP.Net and XSLT

Michael,

Thanks for this great blog post.  

I'd like to get your thoughts on using the technique you've presented here to take an existing WPF SmartClient (Windows) app and process, server-side, the XAML and emit it as an XHTML browser-based app for an open Internet audience (people who may not have the Silverlight plugin)?

Exuse my newbie-ness (to WPF/Silverlight), but if this is a viable approach, aren't there going to be implications for both client-side scripting and server-side event handling/postbacks/etc.?

Thanks in advance!

Thursday, October 25, 2007 9:28 AM by Erik

# re: Simple Silverlight SEO with ASP.Net and XSLT

Erik,

That approach would work great.  You just have to find a format that's rich enough to support the various clients format that you want to render in. You might want to come to this webinar on a related topic: http://blogs.msdn.com/synergist/archive/2007/10/24/upcoming-webinar-better-online-documentation-creating-wpf-flowdocuments-from-word-2007.aspx

The basic approach is that the XML format is great becauase it is easily transformable.  As long as the data is well-formed XML it can be transformed and adapted to other XML formats like XAML, Open XML, XHTML, or Silverlight XAML.

Michael

Thursday, October 25, 2007 1:27 PM by Michael S. Scherotter

# re: Simple Silverlight SEO with ASP.Net and XSLT

Michael,

Thanks for the response.  But, what about interactivity of the app?  I can see how rendering of the XAML to XHTML using this method for the purpose of SEO would work well.

The purpose rendering it as a cross-browser "app" (with interactivity) would at least require the ability for callbacks to services, etc.  I'd guess that would have to be templated as well (and have to use something like AJAX), and would get complicated quickly.  What are you thoughts given this purpose?

Thanks in advance.

Friday, October 26, 2007 9:12 AM by Erik

# re: Simple Silverlight SEO with ASP.Net and XSLT

Hi,

I created a similar test on <a href="http://www.silverlightseo.net" title="Silverlight SEO">http://www.silverlightseo.net</a> just before the new year. Yes it has Silverlight SEO in the domain name and it does have an inbound link with the keywords from my blog posting which can affect the results. More info about the approach I took is on my <a href="http://weblogs.asp.net/jmandia/archive/2008/01/04/silverlight-seo-search-engine-optimisation-optimization.aspx">blog posting</a>.

John

Thursday, January 10, 2008 4:12 PM by John M

# Expression Studio 2 Ships and How to do SEO with Silverlight Pages

by Don Burnett Well it's been a bit since I posted I had been working really hard and somehow I ended up getting pneumonia. So I have been taking a break, but several exciting things happened that I figure I should tell you about. Expression Studio Version

Tuesday, May 06, 2008 11:50 PM by TrackBack

# Silverlight

SliverlightSEODemo

http://xmldocs.net/seo/ SimpleSilverlightSEOwithASP.NetandXSLT

http...

Friday, May 16, 2008 5:59 AM by AllenWang.NET

# re: Simple Silverlight SEO with ASP.Net and XSLT

From what i understand, google does not index hidden divs.  http://www.seroundtable.com/archives/002971.html

A bunch of flex guys tried a similar approach and verfied that google skips the hidden divs.

Monday, June 30, 2008 10:35 PM by tim Kadom

# re: Simple Silverlight SEO with ASP.Net and XSLT

From what i understand, google does not index hidden divs.  http://www.seroundtable.com/archives/002971.html

A bunch of flex guys tried a similar approach and verfied that google skips the hidden divs.

Monday, June 30, 2008 10:36 PM by tim Kadom

# re: Simple Silverlight SEO with ASP.Net and XSLT

Tim,

You're right. but in this case the divs are not hidden, they're just replaced with the Silverlight if the browser has Silverlight installed.

Michael

Monday, June 30, 2008 10:43 PM by Michael S. Scherotter

# Always 英文技术文章参照( 四 ){ UpdateTime:2008-7-8; } My article in the cnblogs

1.GridView排序。http://geekswithblogs.net/azamsharp/archive/2006/04/27/76612.aspx

2.创建Loading控件。one:...

Tuesday, July 08, 2008 12:10 AM by 真见

# Always 英文技术文章参照( 四 ){ UpdateTime:2008-7-8; } My article in the cnblogs

1.GridView排序。 http://geekswithblogs.net/azamsharp/archive/2006/04/27/76612.aspx 2.创建Loading控件。one: http

Tuesday, July 08, 2008 12:46 AM by cnblogs.com

# Silverlight FAQ from TechDays

Thanks for everyone who came out to the Toronto and Montreal TechDays. The three Silverlight sessions

Tuesday, November 11, 2008 10:02 AM by Canadian User Experience

# Silverlight FAQ from TechDays

Thanks for everyone who came out to the Toronto and Montreal TechDays. The three Silverlight sessions

Wednesday, November 12, 2008 11:09 PM by Canadian Developer Connection

# re: Simple Silverlight SEO with ASP.Net and XSLT

Hello this is Brianna visiting first time to this site  and find it very interesting. I really like to join it.and really want to continue the discussion with this site..

-------

Brianna

<a href="http://www.widecircles.com" rel="dofollow">SEO</a>

Thursday, November 20, 2008 1:29 AM by brianna102

# 利用ASP.NET和XSLT实现Silverlight搜索引擎优化(SEO)

用ASP.NET XSLT实现Silverlight SEO

Tuesday, December 23, 2008 9:02 PM by Allan.

# Silverlight 2 XML Namespace change

Thanks for the great post!

Just thought I would mention, the namespace in Silverlight 2 has been changed.

For anyone trying this with Silverlight 2, make sure the namespace in the xaml matches the xsl namespace.

The change was from

xmlns="http://schemas.microsoft.com/client/2007"

to     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

Wednesday, December 31, 2008 10:09 AM by J.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker