Jaa


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.

Comments

  • Anonymous
    October 03, 2007
    PingBack from http://www.artofbam.com/wordpress/?p=4960

  • Anonymous
    October 03, 2007
    The technique described in my previous post will work for Silverlight solutions that generate XAML on

  • Anonymous
    October 25, 2007
    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!

  • Anonymous
    October 25, 2007
    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

  • Anonymous
    October 26, 2007
    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.

  • Anonymous
    January 10, 2008
    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

  • Anonymous
    May 06, 2008
    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

  • Anonymous
    May 15, 2008
    SliverlightSEODemo http://xmldocs.net/seo/ SimpleSilverlightSEOwithASP.NetandXSLT http...

  • Anonymous
    June 30, 2008
    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.

  • Anonymous
    June 30, 2008
    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.

  • Anonymous
    June 30, 2008
    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

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

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

  • Anonymous
    November 11, 2008
    Thanks for everyone who came out to the Toronto and Montreal TechDays. The three Silverlight sessions

  • Anonymous
    November 12, 2008
    Thanks for everyone who came out to the Toronto and Montreal TechDays. The three Silverlight sessions

  • Anonymous
    November 19, 2008
    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>