<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Paul's MCS Developer Blog</title><link>http://blogs.msdn.com/paulwhit/default.aspx</link><description>Sharing and blabbing on my findings as a Microsoft consultant</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Recent Microsoft certification exams as a differentiator</title><link>http://blogs.msdn.com/paulwhit/archive/2009/07/06/recent-microsoft-certification-exams-as-a-differentiator.aspx</link><pubDate>Tue, 07 Jul 2009 02:12:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9820900</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/9820900.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=9820900</wfw:commentRss><description>&lt;p&gt;I’m coming off of a stint of a few exams in a row to earn my Microsoft Certified Professional Developer (MCPD) credentials for ASP.NET 3.5, which I obtained last week!&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="477"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="70"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="405"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/MicrosoftCertificationexamsasspecializat_10882/MCPD(rgb)_1259_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="MCPD(rgb)_1259" border="0" alt="MCPD(rgb)_1259" src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/MicrosoftCertificationexamsasspecializat_10882/MCPD(rgb)_1259_thumb.png" width="267" height="80" /&gt;&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;In the past year, I have also passed a few Microsoft Certified Technical Specialist (MCTS) exams for SharePoint, and today I failed (eep!) the &lt;a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=MB2-634&amp;amp;locale=en-us"&gt;MB2-634 CRM 4.0 Extending Microsoft Dynamics&lt;/a&gt; exam (but plan to re-take it).&lt;/p&gt;  &lt;p&gt;Throughout this experience I’ve been considering the impact having these “titles” might have on my employer’s confidence in me and how I’m presented to customers. I refer to the certifications as titles because they’re often displayed in email signatures, including mine: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/MicrosoftCertificationexamsasspecializat_10882/email-signature_1.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="email-signature" border="0" alt="email-signature" src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/MicrosoftCertificationexamsasspecializat_10882/email-signature_thumb_1.png" width="466" height="74" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In my limited experience as an interviewer (I’ve interviewed a dozen or so candidates for various positions within and outside of Microsoft), I have found that the old certifications weren’t terribly useful as a distinguisher. Most of the senior-level candidates had a pile of them (MCSD, MCAD, MCDBA, etc), and they were usually old versions of tests that showed they took a bunch of tests at some point in their career. It was nice to be able to fill in the certification check box, but didn’t always indicate relevant exposure or experience.&lt;/p&gt;  &lt;p&gt;Things are slightly different for me now that there are more clearly versioned exams (such as the ASP.NET Developer 3.5 or SQL Server 2008 exams), and I feel that the titles can be helpful to distinguish developers on a few factors:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Active in Microsoft Learning community&lt;/strong&gt;      &lt;br /&gt;      &lt;br /&gt;With the version-specific exams, I think the most obvious and clear conclusion about someone who takes newer exams is that they make a conscious and committed effort to Microsoft training. Everyone committed to a career that touches Microsoft software (or any other vendor for that matter) may want to pay attention to what the company itself feels is important to learn.      &lt;br /&gt;      &lt;br /&gt;While the learning community is a clear marketing tool for Microsoft to push earlier adoption and drive product sales, it also serves the purpose of producing better Microsoft developers.      &lt;br /&gt;      &lt;br /&gt;In interviews, I usually ask what resources candidates use to keep up on the latest happenings. I like to hear things like blogs, newsgroups, and email distribution lists. Being conscientious of what Microsoft itself pushes out for training shows an additional level of commitment.      &lt;br /&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Up-to-speed on the latest technologies, to some extent       &lt;br /&gt;&lt;/strong&gt;      &lt;br /&gt;I feel strongly that Microsoft focuses its exams on showing the power of its technologies, and mentioning common pain points.       &lt;br /&gt;      &lt;br /&gt;Especially with the developer exams, it’s clearly in Microsoft’s best interest to point out gaps and have developers make the best use of its technologies. If ISVs and business application developers can make Microsoft technologies scream, the company will sell more software.      &lt;br /&gt;      &lt;br /&gt;There are limitations to what can be gleaned from a certification list, of course. In my experience it’s helpful to take practice tests to pass exams, but these sometimes seem to promote memorization of question types rather than actual learning. In the end, though, I’ve always learned valuable lessons from the exams and at least have been exposed to much of the power and pain points of the various technologies covered by the tests.      &lt;br /&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Has specialized or broad knowledge       &lt;br /&gt;&lt;/strong&gt;      &lt;br /&gt;It seems like the impetus of changes to the title structure for exams in the past few years is to help people indicate what they’ve focused on.      &lt;br /&gt;      &lt;br /&gt;Although I’ve not yet realized the impact of my own certifications, I consider it a bonus for my marketability as a consultant to list the titles on my email signature and on my internal résumé. I think it will help the partners and customers I work with to see my focus areas, and help my management to allocate me appropriately in the future.      &lt;br /&gt;      &lt;br /&gt;Additionally, I want to indicate that I’m focused on being knowledgeable in a variety of areas, so I will continue to take exams in .NET development, SQL Server, SharePoint, CRM, and any other technology that I feel will help me solve customer problems in a more effective manner. I’m hoping my employer will see this commitment and allow me to grow into a more senior role as a consultant and/or architect.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There’s no doubt that Microsoft benefits monetarily when people become certified. Passing active and recent exams helps developers and allows employers to distinguish ones who stay current. It’s not a foolproof method, since passing an exam doesn’t always indicate practical knowledge or experience, but the titles can effectively communicate commitment to learning and staying current.   &lt;p&gt;&lt;/p&gt;   &lt;font color="#808080" size="1"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;Disclosure: I work for Microsoft. I get exams, study materials, and practice tests for Microsoft exams for free. I also have access to free exam prep classes (schedule and budget permitting) at internal training events (such as TechReady, an internal training conference) and instructor-led training. However, I still have the same test standards as everyone else and no insight into exam answers.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9820900" width="1" height="1"&gt;</description></item><item><title>Walkthrough: Quick Start with SharePoint Web Services</title><link>http://blogs.msdn.com/paulwhit/archive/2009/04/08/walkthrough-quick-start-with-sharepoint-web-services.aspx</link><pubDate>Wed, 08 Apr 2009 11:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9537715</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/9537715.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=9537715</wfw:commentRss><description>
&lt;STYLE&gt;
&lt;!--
abbr { text-decoration:none; border-bottom: 1px dotted #9F7C54; }
//--&gt;&lt;/STYLE&gt;

&lt;P&gt;&lt;STRONG&gt;Introduction&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Integrating external applications with SharePoint data and functionality is pretty easy, but the documentation is scattered, so I thought it might be helpful to provide a complete solution that covers a few main scenarios.&lt;/P&gt;
&lt;P&gt;I’ve used the SharePoint web services to provide a custom search interface and to populate lookup tables. I’ve also seen it used as a workaround in a few scenarios where the SharePoint Object Model was behaving erratically.&lt;/P&gt;
&lt;P&gt;This post will focus on how to quickly get started with the web services interface in &lt;ABBR title="Windows SharePoint Services"&gt;WSS&lt;/ABBR&gt;, and particularly how to access SharePoint data and search results quickly, in a new project. It’s not very polished, but it gets the job done.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Does this apply to me?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;First, when communicating with &lt;ABBR title="Windows SharePoint Services"&gt;WSS&lt;/ABBR&gt; and &lt;ABBR title="Microsoft Office SharePoint Server"&gt;MOSS&lt;/ABBR&gt;, you have to &lt;STRONG&gt;decide which remote access tool best fits your needs&lt;/STRONG&gt;.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The SharePoint Object Model (i.e. from the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=05E0DD12-8394-402B-8936-A07FE8AFAFFD&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=05E0DD12-8394-402B-8936-A07FE8AFAFFD&amp;amp;displaylang=en"&gt;WSS SDK&lt;/A&gt;) is great when your application is written in .NET and is deployed to a server running MOSS or WSS, &lt;/LI&gt;
&lt;LI&gt;&lt;ABBR title="Remote Procedure Call"&gt;RPC&lt;/ABBR&gt; over &lt;ABBR title="HyperText Transfer Protocol"&gt;HTTP&lt;/ABBR&gt; is apparently good for large file uploads, &lt;/LI&gt;
&lt;LI&gt;WebDAV allows for browsing via Windows Explorer and drive mapping, and &lt;/LI&gt;
&lt;LI&gt;The web services interface is best when you need a connection that doesn’t depend on the WSS/MOSS SDK, when you need to connect from outside .NET code (such as &lt;A href="http://spjslib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22639" mce_href="http://spjslib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22639"&gt;via JavaScript&lt;/A&gt;). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As Alvin Bruney points out in his book &lt;CITE&gt;Programming Excel Services&lt;/CITE&gt; (&lt;A href="http://proquestcombo.safaribooksonline.com/9780735624078" mce_href="http://proquestcombo.safaribooksonline.com/9780735624078"&gt;Safari&lt;/A&gt;), the web services interface is also “a way to access the resources of the server with reduced risk of instability to the server resources.”&lt;/P&gt;
&lt;P&gt;Secondly, &lt;STRONG&gt;figure out if you need to do this from scratch&lt;/STRONG&gt; at all.&lt;/P&gt;
&lt;P align=left&gt;Check into &lt;A href="http://www.codeplex.com/LINQtoSharePoint" mce_href="http://www.codeplex.com/LINQtoSharePoint"&gt;LINQ to SharePoint&lt;/A&gt;, which can use either the SharePoint Object model or the web services interface. It looks like a really slick and robust way to interface with your existing SharePoint data. On the down side, it appears to not have been updated since November 2007 and Bart De Smet, the project’s author (&lt;A href="http://community.bartdesmet.net/blogs/bart/Default.aspx" target=_blank mce_href="http://community.bartdesmet.net/blogs/bart/Default.aspx"&gt;blog&lt;/A&gt;), notes that it is an alpha release and not ready for production. I’ve steered clear of it for that reason and due to client restrictions, but you might save yourself a lot of time if you can use it! &lt;/P&gt;
&lt;P align=left&gt;Check out this video, from the project’s CodePlex page, for a good quick start:&lt;/P&gt;
&lt;P align=center&gt;&amp;nbsp;&lt;A title="LINQ to SharePoint quick start video (5:37, 3.18MB, WMV)" href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022" target=_blank mce_href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=linq2sharepoint-video-thumbnail border=0 alt=linq2sharepoint-video-thumbnail src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/QuickstartwithSharePointWebServices_11870/linq2sharepoint-video-thumbnail_6.jpg" width=302 height=228 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/QuickstartwithSharePointWebServices_11870/linq2sharepoint-video-thumbnail_6.jpg"&gt;&lt;/A&gt; &lt;BR&gt;LINQ to SharePoint quick start &lt;A href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022" mce_href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022"&gt;video&lt;/A&gt; (5:37, 3.18MB, WMV)&lt;/P&gt;
&lt;P&gt;If you decide against LINQ to SharePoint, you can still easily add web references and consume the SharePoint web services in your custom code.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Walkthrough: Accessing List data&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;As it turns out, the web host for &lt;A href="http://handsondc.org/" target=_blank mce_href="http://handsondc.org"&gt;Hands on DC&lt;/A&gt; (a volunteer organization with which I work) does some hokey things with NTLM authentication that aren’t supported by &lt;ABBR title="Windows Communication Foundation"&gt;WCF&lt;/ABBR&gt;. Namely, it seems like they’re doing Transport level authentication over plaintext HTTP instead of HTTP over SSL. I can see why this isn’t supported, for security reasons. Despite Dan Rigby’s &lt;A href="http://www.danrigsby.com/blog/index.php/2008/04/17/impersonate-a-clients-identity-in-wcf/#high_1" target=_blank mce_href="http://www.danrigsby.com/blog/index.php/2008/04/17/impersonate-a-clients-identity-in-wcf/#high_1"&gt;excellent post about impersonation in WCF&lt;/A&gt;, I couldn’t get anything to work.&lt;/P&gt;
&lt;P&gt;But alas, with no slight of hand whatsoever, the scenario works in VS2005 and a regular old-school ASMX-based web service proxy (web reference). Here’s a quick (and quite dirty) example, initially based on Ishai Sagi’s (&lt;A href="http://www.sharepoint-tips.com/" target=_blank mce_href="http://www.sharepoint-tips.com/"&gt;blog&lt;/A&gt;) &lt;A href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd/" target=_blank mce_href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd/"&gt;response on MSDN&lt;/A&gt;: &lt;/P&gt;
&lt;P align=center&gt;Video hint: Click the full screen icon (looks like a TV) &lt;BR&gt;&lt;BR&gt;&lt;EMBED height=289 type=application/x-shockwave-flash width=459 src=http://blip.tv/play/AfjwYZXTNQ allowfullscreen="true" allowscriptaccess="always" mce_src="http://blip.tv/play/AfjwYZXTNQ"&gt;&lt;/EMBED&gt; &lt;BR&gt;&lt;A href="http://paulw.us/TestWS_publish.zip" target=_blank mce_href="http://paulw.us/TestWS_publish.zip"&gt;Download source code&lt;/A&gt; (39KB, ZIP file)&lt;/P&gt;
&lt;P&gt;The query that we send to the list service is written in &lt;ABBR title="Collaborative Application Markup Language"&gt;CAML&lt;/ABBR&gt;. When we want to get more complex in our query, such as only pulling back certain columns, check out the &lt;A href="http://www.u2u.net/res/Tools/CamlQueryBuilder.aspx" target=_blank mce_href="http://www.u2u.net/res/Tools/CamlQueryBuilder.aspx"&gt;U2U CAML Query Builder&lt;/A&gt;. It provides an awesome interface into creating your CAML queries.&lt;/P&gt;
&lt;P&gt;In the WCF world, Kirk Evans has an awesome walkthrough, &lt;A href="http://blogs.msdn.com/kaevans/archive/2009/03/10/calling-sharepoint-lists-web-service-using-wcf.aspx" target=_blank mce_href="http://blogs.msdn.com/kaevans/archive/2009/03/10/calling-sharepoint-lists-web-service-using-wcf.aspx"&gt;Calling SharePoint Lists Web Service using WCF&lt;/A&gt;, which includes how to streamline the XML access by using an XPathNavigator, and later using a DataTable that reads from an XmlNodeReader. Better than querying the fields directly for sure!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Walkthrough: Querying WSS Search Results&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Search is a little more challenging. As is the case with every other web service, we send the query service XML, and it returns XML. We can take a shortcut and generate the request XML with a tool such as the &lt;A href="http://www.mosssearch.com/searchwebservice.html" target=_blank&gt;Search Query Web Service Test Tool for MOSS&lt;/A&gt; (or we could also import the schema and generate a C# class from it).&lt;/P&gt;
&lt;P&gt;Since I’m a big fan of &lt;A href="http://quickstart.developerfusion.co.uk/quickstart/howto/doc/xmlserialization/XSDToCls.aspx" target=_blank mce_href="http://quickstart.developerfusion.co.uk/quickstart/howto/doc/xmlserialization/XSDToCls.aspx"&gt;using XSD.EXE to generate a C# class&lt;/A&gt;, I chose to do so with the search result support classes. It was mostly productive, although the Results node is free-form (can take any node type) and the generator doesn’t seem to support that. In the end, we can use the generated classes to get statistics about the data set, and can navigate the Documents using regular XML methods. &lt;/P&gt;
&lt;P&gt;Here is a complete walkthrough of adding very basic search results, including a total result count and the first page of results, to our application:&lt;/P&gt;
&lt;P align=center&gt;Video hint: Click the full screen icon (looks like a TV) &lt;BR&gt;&lt;BR&gt;&lt;EMBED height=289 type=application/x-shockwave-flash width=459 src=http://blip.tv/play/Afj2bpXTNQ allowfullscreen="true" allowscriptaccess="always" mce_src="http://blip.tv/play/Afj2bpXTNQ"&gt;&lt;/EMBED&gt; &lt;BR&gt;&lt;A href="http://paulw.us/TestWS_publish_2.zip" target=_blank mce_href="http://paulw.us/TestWS_publish_2.zip"&gt;Download source code&lt;/A&gt; (56KB, ZIP file)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Conclusion&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Use SharePoint web services when you have the need to separate concerns and reduce risk inherent with new code deployments to the SharePoint farm, you want remote access to SharePoint from a non-SharePoint server, or you need to access SharePoint from something other than .NET (such as JavaScript).&lt;/P&gt;
&lt;P&gt;This post and associated videos walked you through creating a Windows Forms application, from scratch, that pulls data in from SharePoint, including List-based data and search results. The process is similar to any other web service, but there are a few gotchas and pain points that I hope have been cleared up in this resource.&lt;/P&gt;
&lt;P&gt;I collected some additional links in the process of putting this post together, and added them on delicious with the tag “&lt;A href="http://delicious.com/paulwhit/sharepoint-webservices" target=_blank mce_href="http://delicious.com/paulwhit/sharepoint-webservices"&gt;sharepoint-webservices&lt;/A&gt;”.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9537715" width="1" height="1"&gt;</description></item><item><title>Walkthrough: full example of using MvcContrib grid with jQuery datatable</title><link>http://blogs.msdn.com/paulwhit/archive/2009/03/28/walkthrough-full-example-of-using-mvccontrib-grid-with-jquery-datatable.aspx</link><pubDate>Sun, 29 Mar 2009 06:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9516639</guid><dc:creator>paulwhit</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/9516639.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=9516639</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Note: This walkthrough is based on the 1.0 release of ASP.NET MVC, MvcContrib version 1.0.0.916 with a &lt;A href="http://mvccontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4134" mce_href="http://mvccontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4134"&gt;minor code change&lt;/A&gt;, jQuery 1.2.6 (included in the MVC release) and &lt;A href="http://www.sprymedia.co.uk/article/DataTables" mce_href="http://www.sprymedia.co.uk/article/DataTables"&gt;jQuery datatables 1.4&lt;/A&gt;. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Introduction&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For the past few months (and 100+ volunteer hours!) I’ve been creating a web application for &lt;A href="http://handsondc.org/" mce_href="http://handsondc.org"&gt;Hands on DC&lt;/A&gt; that calculates volunteers, gallons of paint, and materials for work projects for their annual &lt;A href="http://handsondc.kintera.org/faf/home/default.asp?ievent=297211" mce_href="http://handsondc.kintera.org/faf/home/default.asp?ievent=297211"&gt;Work-a-Thon event&lt;/A&gt;. After the encouragement of a few coworkers who did some initial work on the project, I committed to using &lt;A href="http://www.asp.net/mvc/" mce_href="http://www.asp.net/mvc/"&gt;ASP.NET MVC&lt;/A&gt;, technology which has been out over a year but just reached a production 1.0 &lt;A href="http://haacked.com/archive/2009/03/18/aspnet-mvc-rtw.aspx" mce_href="http://haacked.com/archive/2009/03/18/aspnet-mvc-rtw.aspx"&gt;release at Mix 09&lt;/A&gt; this year. &lt;/P&gt;
&lt;P&gt;Getting up and running with MVC wasn’t an easy task. The project was also my first foray into LINQ to SQL, and really .NET 3.5 in general, so it was a little intimidating at first! There’s not much documentation and it’s split across the many release versions of MVC. The main site will get you up doing very basic things (but is seriously lacking content), though Phil Haack’s &lt;A href="http://channel9.msdn.com/pdc2008/PC21/" mce_href="http://channel9.msdn.com/pdc2008/PC21/"&gt;webcast&lt;/A&gt; and Scott Hanselman, et. al.’s &lt;A href="http://www.hanselman.com/blog/FreeASPNETMVCEBookNerdDinnercomWalkthrough.aspx" mce_href="http://www.hanselman.com/blog/FreeASPNETMVCEBookNerdDinnercomWalkthrough.aspx"&gt;free e-Book&lt;/A&gt; are helpful.&lt;/P&gt;
&lt;P&gt;In the process, I discovered some important companion pieces in &lt;A href="http://www.codeplex.com/MVCContrib" mce_href="http://www.codeplex.com/MVCContrib"&gt;MvcContrib&lt;/A&gt; and jQuery, including the &lt;A href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" mce_href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/"&gt;validation plugin&lt;/A&gt; and the &lt;A href="http://www.sprymedia.co.uk/article/DataTables" mce_href="http://www.sprymedia.co.uk/article/DataTables"&gt;datatable plugin&lt;/A&gt;. I want to highlight work that I did to combine the MvcContrib data grid with the datatable for sorting, paging and filtering. This was something I struggled with for several hours, so I’m hoping there is some value in posting the full example.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=projects border=0 alt=projects src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/projects_3.png" width=402 height=202 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/projects_3.png"&gt;Figure 1. Example of using MvcContrib with jQuery datatable plugin. &lt;/P&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Walkthrough&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Here is a complete from-scratch example. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create a new ASP.NET MVC Web Application. Press F5 to make sure it runs. &lt;/LI&gt;
&lt;LI&gt;Drag and drop the “media” folder from the datatable project directory (where you unzipped the project) into the new Solution, like so: &lt;/LI&gt;&lt;/UL&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=datatable-media border=0 alt=datatable-media src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_thumb.png" width=214 height=329 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_thumb.png"&gt;&lt;/A&gt; Figure 2. Solution after copying the datatable media folder. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Add a reference to the MvcContrib.dll. &lt;/LI&gt;
&lt;LI&gt;Open the Views/Home/Index.aspx file and add the following under the page directive: &lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%@ Import Namespace="MvcContrib.UI.Grid" %&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%@ Import Namespace="MvcContrib.UI.Grid.ActionSyntax" %&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;UL&gt;
&lt;LI&gt;Open the Views/Shared/Site.Master file and add references to jquery, jquery.dataTables and the demos.css file, like so: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %&amp;gt;&lt;/SPAN&gt; 

&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;html&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://www.w3.org/1999/xhtml"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;runat&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"server"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;asp&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;ContentPlaceHolder&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;ID&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"TitleContent"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;runat&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"server"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;link&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../Content/Site.css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;rel&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"stylesheet"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;link&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../media/css/demos.css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;rel&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"stylesheet"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;src&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../media/js/jquery.js"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/javascript"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;src&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../media/js/jquery.dataTables.js"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/javascript"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Now set up some dummy data in the HomeController.cs file like so (add to the body of the class): &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;enum&lt;/SPAN&gt; Medal
{
    Gold,
    Silver,
    Bronze
}

&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; MedalWinner
{
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Location { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Year { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Sport { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; Medal Medal { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Country { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Name { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }

    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; MedalWinner(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; l, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; y, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; s, Medal m, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; c, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; n)
    {
        Location = l;
        Year = y;
        Sport = s;
        Medal = m;
        Country = c;
        Name = n;
    }
}

&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; ActionResult Index()
{
    ViewData["&lt;SPAN style="COLOR: #8b0000"&gt;Message&lt;/SPAN&gt;"] = "&lt;SPAN style="COLOR: #8b0000"&gt;Welcome to ASP.NET MVC!&lt;/SPAN&gt;";

    var medalWinners = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; List&amp;lt;MedalWinner&amp;gt;();
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Gold, "&lt;SPAN style="COLOR: #8b0000"&gt;Croatia&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;LOSERT, Veni&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Gold, "&lt;SPAN style="COLOR: #8b0000"&gt;Croatia&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;BALIC, Ivano&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Gold, "&lt;SPAN style="COLOR: #8b0000"&gt;Croatia&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;ZRNIC, Vedran&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Silver, "&lt;SPAN style="COLOR: #8b0000"&gt;Germany&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;JANSEN, Torsten&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Silver, "&lt;SPAN style="COLOR: #8b0000"&gt;Germany&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;KRETZSCHMAR, Stefan&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Silver, "&lt;SPAN style="COLOR: #8b0000"&gt;Germany&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;VON BEHREN, Frank &lt;/SPAN&gt;"));

    ViewData["&lt;SPAN style="COLOR: #8b0000"&gt;MedalWinners&lt;/SPAN&gt;"] = medalWinners;

    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; View();
}&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp; Now we have some data to work with. In the view (ViewData[“MedalWinners”]). Test that theory by adding the following code to the “indexContent” content block in Views/Home/Index.aspx: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;ol&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; foreach (HomeController.MedalWinner winner 
       in (List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"] )
{ &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;li&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= winner.Name &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;, &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= winner.Country &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;li&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; } &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;ol&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;You should see output like this: &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners1 border=0 alt=medalwinners1 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_thumb.png" width=402 height=214 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Assuming that worked, we’re ready to do some grid work! Once you get the basic syntax, the MvcContrib grid makes display a cinch. This is the “action syntax” so make sure your imports are right (shown at the top of the walkthrough. &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; Html.Grid((List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"])
       .Columns(column =&amp;gt;
       {
           column.For(c =&amp;gt; c.Year);
           column.For(c =&amp;gt; c.Location);
           column.For(c =&amp;gt; c.Name);
           column.For(c =&amp;gt; c.Country);
           column.For(c =&amp;gt; c.Medal.ToString());
           column.For(c =&amp;gt; c.Sport);
       }).Render();
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Run the application; you should see output like so: &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners2 border=0 alt=medalwinners2 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_thumb.png" width=402 height=262 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_thumb.png"&gt;&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;That’s pretty easy, but not terribly useful yet. For fun, let’s add a Live search on the name field so we can see who these athletes are. The “Action Syntax” makes it simple to do powerful clean custom code for each cell. Pretty slick! Note that you need to specify the table cell tags or you’ll get messed up output. &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; Html.Grid((List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"])
       .Columns(column =&amp;gt;
       {
           column.For(c =&amp;gt; c.Year);
           column.For(c =&amp;gt; c.Location);
           column.For(c =&amp;gt; c.Name).Named("Athlete Name").Action(a =&amp;gt; {&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=
               &lt;SPAN style="COLOR: #0000ff"&gt;"http://search.live.com/results.aspx?q=&amp;lt;%= HttpUtility.UrlEncode(a.Name) %&amp;gt;&amp;amp;form=QBLH"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= HttpUtility.HtmlEncode(a.Name) &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
           &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;
           });
           column.For(c =&amp;gt; c.Country);
           column.For(c =&amp;gt; c.Medal.ToString());
           column.For(c =&amp;gt; c.Sport);
       }).Render();
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;So now our output name is linked to a Live Search. &lt;/LI&gt;
&lt;LI&gt;Now we’re ready to incorporate the jquery datatable stuff. If you see in the directory that you unzipped the datatable project to, there is an “eaxmple_zero_config.html” file. Let’s steal the code from the top of that. &lt;BR&gt;&lt;BR&gt;In order to get this to work, we need to add an id attribute to the grid, as is shown below. &lt;BR&gt;&lt;BR&gt;Let’s also style it a little by putting it in a container. Otherwise the search box doesn’t align with the table and looks a little wonky: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/javascript"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;charset&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"utf-8"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    $(document).ready(function() {
        $('#example').dataTable();
    });
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
#example { width: 100%; }
#container { width: 600px; }
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;div&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;id&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"container"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; Html.Grid((List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"])
       .Columns(column =&amp;gt;
       {
           column.For(c =&amp;gt; c.Year);
           column.For(c =&amp;gt; c.Location);
           column.For(c =&amp;gt; c.Name).Named("Athlete Name").Action(a =&amp;gt; {&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=
               &lt;SPAN style="COLOR: #0000ff"&gt;"http://search.live.com/results.aspx?q=&amp;lt;%= HttpUtility.UrlEncode(a.Name) %&amp;gt;&amp;amp;form=QBLH"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= HttpUtility.HtmlEncode(a.Name) &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
           &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;
           });
           column.For(c =&amp;gt; c.Country);
           column.For(c =&amp;gt; c.Medal.ToString());
           column.For(c =&amp;gt; c.Sport);
       }).Attributes(id =&amp;gt; "example").Render();
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;div&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Now we can do sorting by clicking the column names, filtering by entering text in the search box, and pagination by selecting the drop-down for “show X entries”. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_4.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_4.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners3 border=0 alt=medalwinners3 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_thumb_1.png" width=402 height=290 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;That’s pretty much it! Before we part, let’s make a quick foray into the syntax of making changes to the datatable initialization code. We can disable columns so they can’t be sorted, create a custom sort order, and change the default length by setting some properties. Let’s disable sorting by the first and sixth columns, sort by name by default, and set the default paging to 25. Just change the javascript block to this: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;$(&lt;SPAN style="COLOR: #0000ff"&gt;document&lt;/SPAN&gt;).ready(&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;() {
    $('#example').dataTable({
        "&lt;SPAN style="COLOR: #8b0000"&gt;iDisplayLength&lt;/SPAN&gt;": 25,
        "&lt;SPAN style="COLOR: #8b0000"&gt;aaSorting&lt;/SPAN&gt;": [[2, "&lt;SPAN style="COLOR: #8b0000"&gt;asc&lt;/SPAN&gt;"]],
        "&lt;SPAN style="COLOR: #8b0000"&gt;aoColumns&lt;/SPAN&gt;": [{ "&lt;SPAN style="COLOR: #8b0000"&gt;bSortable&lt;/SPAN&gt;": &lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt; }, &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;,
            &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;, { "&lt;SPAN style="COLOR: #8b0000"&gt;bSortable&lt;/SPAN&gt;": &lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt;}]
    });
});&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;And voilá! &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners4 border=0 alt=medalwinners4 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_thumb.png" width=402 height=292 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://paulw.us/grid-example.zip" mce_href="http://paulw.us/grid-example.zip"&gt;[Download complete source code]&lt;/A&gt; (394KB, ZIP file)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9516639" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/paulwhit/archive/tags/c_2300_/default.aspx">c#</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/mvccontrib/default.aspx">mvccontrib</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/datatable/default.aspx">datatable</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/mvc/default.aspx">mvc</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/jquery/default.aspx">jquery</category></item><item><title>Get common dates in T-SQL</title><link>http://blogs.msdn.com/paulwhit/archive/2008/06/25/get-common-dates-in-t-sql.aspx</link><pubDate>Wed, 25 Jun 2008 21:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8652703</guid><dc:creator>paulwhit</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/8652703.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=8652703</wfw:commentRss><description>&lt;P&gt;A few years ago I created &lt;A class="" title="My developer.com article on dynamic date parameters in T-SQL and Reporting Services" href="http://www.developer.com/db/article.php/10920_3513996_2" mce_href="http://www.developer.com/db/article.php/10920_3513996_2"&gt;an article&lt;/A&gt; around Reporting Services and dates. It could have been written more generically, because I&amp;nbsp;reference this quite a bit to get common dates like "the beginning of this week", "midnight last night", etc, in my SQL queries. It's a fairly comprehensive list of relative dates that one might want to get in T-SQL for reporting, scheduling, etc.&lt;/P&gt;
&lt;P&gt;It can get pretty complex, such as this function for getting the end of the current week&lt;/P&gt;
&lt;P&gt;CREATE FUNCTION get_week_end (@date datetime)&lt;BR&gt;RETURNS datetime AS&lt;BR&gt;BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp; return dateadd(yyyy, datepart(yyyy,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateadd(weekday,7-datepart(weekday, @date),@date))-1900, 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + dateadd(ms, -3,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateadd(dy, datepart(dy,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateadd(weekday,7-datepart(weekday, @date),@date)),0) )&lt;BR&gt;END&lt;/P&gt;
&lt;P&gt;If you don't find what you need, you can typically use the dateadd function to tweak one of these. Here is the complete list outlined in the article:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Start of this week&lt;/LI&gt;
&lt;LI&gt;End of this week&lt;/LI&gt;
&lt;LI&gt;Start of last week&lt;/LI&gt;
&lt;LI&gt;End of last week&lt;/LI&gt;
&lt;LI&gt;Start of this month&lt;/LI&gt;
&lt;LI&gt;End of this month&lt;/LI&gt;
&lt;LI&gt;Start of last month&lt;/LI&gt;
&lt;LI&gt;End of last month&lt;/LI&gt;
&lt;LI&gt;Start of the day yesterday&lt;/LI&gt;
&lt;LI&gt;End of the day yesterday&lt;/LI&gt;
&lt;LI&gt;Start of the day today&lt;/LI&gt;
&lt;LI&gt;End of the day today&lt;/LI&gt;
&lt;LI&gt;Start of the day this Monday&lt;/LI&gt;
&lt;LI&gt;End of the day this Monday&lt;/LI&gt;
&lt;LI&gt;Start of the year&lt;/LI&gt;
&lt;LI&gt;Tomorrow at noon&lt;/LI&gt;
&lt;LI&gt;Today at noon&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8652703" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/paulwhit/archive/tags/dynamic+date/default.aspx">dynamic date</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/sql/default.aspx">sql</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/query/default.aspx">query</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/t-sql/default.aspx">t-sql</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/dates/default.aspx">dates</category></item><item><title>New SharePoint Developer Resource</title><link>http://blogs.msdn.com/paulwhit/archive/2008/06/14/new-sharepoint-developer-resource.aspx</link><pubDate>Sat, 14 Jun 2008 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8597797</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/8597797.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=8597797</wfw:commentRss><description>As part of the &lt;A class="" href="http://caparea.net/" mce_href="http://caparea.net"&gt;Capital Area .NET&lt;/A&gt;'s new SharePoint SIG, I led a discussion group last week which worked together to create a WSS/MOSS Developer Productivity Wiki Page. Check it out on &lt;A class="" href="http://wsswiki.com/Developer_productivity_tips_and_tools" mce_href="http://wsswiki.com/Developer_productivity_tips_and_tools"&gt;WSSWiki.com&lt;/A&gt;, and please feel free to add to it!&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8597797" width="1" height="1"&gt;</description></item><item><title>Personal Twitter Client Counter</title><link>http://blogs.msdn.com/paulwhit/archive/2008/04/29/personal-twitter-client-counter.aspx</link><pubDate>Wed, 30 Apr 2008 06:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8440933</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/8440933.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=8440933</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Get a count and percentage of how many updates you've had with each twitter tool.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://paulw.us/blog/uploads/TwitterClientCounterWPF.zip" mce_href="http://paulw.us/blog/uploads/TwitterClientCounterWPF.zip"&gt;Download C# 3.5 WPF Source Code&lt;/A&gt; &lt;BR&gt;Note: This source code is mostly a quick hack to get the data I wanted. Also, if you run this on your own data, note that you may need to wait a few minutes for results to come back.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In testing out various &lt;A href="http://www.readwriteweb.com/archives/top_twitter_clients_definitive_list.php" mce_href="http://www.readwriteweb.com/archives/top_twitter_clients_definitive_list.php"&gt;twitter clients&lt;/A&gt;, I wanted to get a feel for my personal usage (how much I've used each client), so I decided I'd write some code around it. To begin, here are the results:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;web, 1770, 41.549%&amp;nbsp; &lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_4.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 15px; BORDER-RIGHT-WIDTH: 0px" height=244 alt=Clipboard02 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_thumb_1.png" width=219 align=right border=0 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_thumb_1.png"&gt;&lt;/A&gt; &lt;BR&gt;im, 1214, 28.498% &lt;BR&gt;txt, 713, 16.737% &lt;BR&gt;SnapFoo, 153, 3.592% &lt;BR&gt;twigadge, 146, 3.427% &lt;BR&gt;Twadget, 128, 3.005% &lt;BR&gt;TwitterFox, 61, 1.432% &lt;BR&gt;Snitter, 21, 0.493%&amp;nbsp; &lt;BR&gt;Jott, 17, 0.399% &lt;BR&gt;TwitBin, 16, 0.376% &lt;BR&gt;twitterfeed, 7, 0.164% &lt;BR&gt;Spaz, 6, 0.141% &lt;BR&gt;Twitter Opera widget, 3, 0.070% &lt;BR&gt;twhirl, 3, 0.070% &lt;BR&gt;Twittearth, 2, 0.047%&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I snagged an &lt;A href="http://chakkaradeep.wordpress.com/2008/04/05/a-simple-twitter-client-to-demonstrate-backgroundworker/" mce_href="http://chakkaradeep.wordpress.com/2008/04/05/a-simple-twitter-client-to-demonstrate-backgroundworker/"&gt;API code sample&lt;/A&gt; and fired up my trusty Visual Studio 2005. Thankfully (so I could step out of my box a bit), the code sample was in C# 3.5! So... I popped open my laptop and set out coding (finally, for the first time outside of dragging some controls around) in Visual Studio 2008.&lt;/P&gt;
&lt;P&gt;As part of this, I wrote my first LINQ-to-XML query!&lt;/P&gt;
&lt;P&gt;This code makes a request to twitter (you have to be authenticated first) and gets an &lt;A href="http://en.wikipedia.org/wiki/Anonymous_type" mce_href="http://en.wikipedia.org/wiki/Anonymous_type"&gt;anonymous type&lt;/A&gt; list called sc that has the key (the name of the source, as shown above) and the count from that page. After that I work some magic to aggregate them across all pages, though I'm investigating how to do the aggregation by first combining the XElement-s from each page (though that would take up a lot of memory).&lt;/P&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;url = &lt;SPAN style="COLOR: #006080"&gt;"http://twitter.com/account/archive.xml?page="&lt;/SPAN&gt; + x.ToString();

WebRequest Request = HttpWebRequest.Create(url);
Request.Credentials = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; NetworkCredential(userName, password);
WebResponse Response = Request.GetResponse();
Stream stream = Response.GetResponseStream();
TextReader reader = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; StringReader(&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; StreamReader(stream).ReadToEnd());
XElement statuses = XElement.Load(reader);

&lt;SPAN style="COLOR: #008000"&gt;// My first LINQ query!&lt;/SPAN&gt;
var sourceNames = from source &lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt; statuses.Descendants(&lt;SPAN style="COLOR: #006080"&gt;"source"&lt;/SPAN&gt;)
                  group source by source.Value into sc
                  orderby sc.Count() descending
                  select &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; { sc.Key, MyCount = sc.Count() };&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;I also got to play around in WPF just a little. Nothing fancy at all, but it was nice to see the new IDE in action. It feels much more powerful.&lt;/P&gt;
&lt;P&gt;I may play around with this some more, add graphing, toy around with it as a Silverlight 2 app. Or it might just sit there and do nothing ;-)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you'd like a more full-featured statistics tool for your twitter status updates, check out &lt;A class="" title=TweetStats href="http://www.tweetstats.com/" mce_href="http://www.tweetstats.com"&gt;TweetStats&lt;/A&gt; (&lt;A class="" title="TweetStats for @paulwhit" href="http://tweetstats.com/graphs/paulwhit" mce_href="http://tweetstats.com/graphs/paulwhit"&gt;my stats&lt;/A&gt;).&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8440933" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/paulwhit/archive/tags/tool/default.aspx">tool</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/c_2300_/default.aspx">c#</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/winforms/default.aspx">winforms</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/wpf/default.aspx">wpf</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/client/default.aspx">client</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/twitter/default.aspx">twitter</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/counter/default.aspx">counter</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/usage/default.aspx">usage</category></item><item><title>Latest tool: XPath query field extractor for InfoPath</title><link>http://blogs.msdn.com/paulwhit/archive/2008/04/16/latest-tool-xpath-query-field-extractor-for-infopath.aspx</link><pubDate>Wed, 16 Apr 2008 10:55:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8398490</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/8398490.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=8398490</wfw:commentRss><description>&lt;blockquote&gt; &lt;p&gt;Update: This tool seems to be only relevant with InfoPath 2003. A co-worker pointed out that due the customer pains around a lack of a feature like this, in InfoPath 2007 you can right-click a node in the data source and choose "Copy XPath". Cool! Thanks to Scott Heim for pointing this out.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So, I love making tools. One-off things that process something. Batch files that lessen monotony. Sexy little WinForm apps for displaying data. XSL transformations that regurgitate and pre-process XML. &lt;/p&gt; &lt;p&gt;My latest tool is a small WinForms app that pulls out a list of fields form an InfoPath document so they can be referenced as XPath. This is pretty neat because my client needed a documentation artifact, and this saved quite a bit of tedium. Getting this data also proved difficult because the Namespace URI for the "my" namespace is always changing because it includes a timestamp (see solution below).&lt;/p&gt; &lt;p&gt;Here's a sample of the output. You can use each of these lines as XPath queries against the document:&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;p&gt;my:MyFields/my:secMain
my:MyFields/my:secMain/my:secPhysicalDescriptionHeader
my:MyFields/my:secMain/my:secDualCitizenshipMain
my:MyFields/my:secMain/my:secDualCitizenshipMain/my:secDualCitizenshipName
my:MyFields/my:secMain/my:secDualCitizenshipMain/my:secDualCitizenship&lt;br&gt;.&lt;br&gt;.&lt;br&gt;.&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The tool uses the &lt;a href="http://support.microsoft.com/kb/310618"&gt;CAB SDK&lt;/a&gt;'s extract.exe via a command shell to pull out the template.xml file from the InfoPath XSN file.&lt;/p&gt;
&lt;p&gt;The code for using the SDK was pretty straightforward. In this case (since we want the XML template in the InfoPath, the variable ExtractionFileName is defined as:&lt;/p&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ExtractionFileName = &lt;span style="color: #006080"&gt;"template.xml"&lt;/span&gt;;&lt;/pre&gt;
&lt;p&gt;And fileName is the location of the XSN file. The code for the extraction is:&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;// Use the CAB SDK to grab the template file from the InfoPath XSN package&lt;/span&gt;
Process proc = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Process();
proc.StartInfo.FileName = &lt;span style="color: #006080"&gt;".\\EXTRACT.EXE"&lt;/span&gt;;
proc.StartInfo.Arguments = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;"\"{0}\" {1}"&lt;/span&gt;, fileName, ExtractionFileName);
proc.StartInfo.UseShellExecute = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
proc.WaitForExit();&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Dealing with the ever-changing "my" namespace&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One particular challenge arose. Since the "my" namespace in InfoPath is defined with a timestamp, every time you change the schema the namespace URI changes. So, I had to do a little preprocessing before I could read the fields (since they're all in the "my" namespace). Thankfully the timestamp is of fixed length.&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;XmlDocument doc = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlDocument();
doc.Load(extractionFilePath);

&lt;span style="color: #008000"&gt;// Use a low-tech way to get the "my:" namespace URI, since it &lt;/span&gt;
&lt;span style="color: #008000"&gt;// differs by form and when changes are made&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fileContents = File.ReadAllText(extractionFilePath);
&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; myIndex = fileContents.IndexOf(&lt;span style="color: #006080"&gt;"xmlns:my="&lt;/span&gt;) + 10;
&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; myNamespace = fileContents.Substring(myIndex, 75);

XmlNamespaceManager mgr = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlNamespaceManager(doc.NameTable);
mgr.AddNamespace(&lt;span style="color: #006080"&gt;"my"&lt;/span&gt;, myNamespace);

XmlNode myFieldsNode = doc.SelectSingleNode(&lt;span style="color: #006080"&gt;"//my:myFields"&lt;/span&gt;, mgr);&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After you get the "myFieldsNode" you can recursively iterate through the nodes and output the fields.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8398490" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/paulwhit/archive/tags/infopath/default.aspx">infopath</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/namespace/default.aspx">namespace</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/tool/default.aspx">tool</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/c_2300_/default.aspx">c#</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/2.0/default.aspx">2.0</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/2003/default.aspx">2003</category></item><item><title>Synchronize XSD from an InfoPath document with a SharePoint project for server-side XSD validation</title><link>http://blogs.msdn.com/paulwhit/archive/2008/04/15/synchronize-xsd-from-an-infopath-document-with-a-sharepoint-project-for-server-side-xsd-validation.aspx</link><pubDate>Tue, 15 Apr 2008 10:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8395928</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/8395928.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=8395928</wfw:commentRss><description>&lt;p&gt;In order to implement server-side XSD validation against an InfoPath form submission, I had to pull the XSD from the InfoPath document archive (XSN file) and use that to update an embedded resource in a SharePoint solution project (including automated checkout/checkin in TFS). I was able to do it using a batch file. &lt;/p&gt; &lt;p&gt;Pretty specialized need, but maybe somebody could make use of it someday ;).&lt;/p&gt; &lt;p&gt;Note: If you want to use this code, you'll have to combine some of the lines that were too long to display.&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;@echo off 

&lt;span style="color: #008000"&gt;rem ***********************************************************&lt;/span&gt;
&lt;span style="color: #008000"&gt;rem This batch file is used to extract the XSD files from each &lt;/span&gt;
&lt;span style="color: #008000"&gt;rem of the InfoPath forms, and copy them into the source tree&lt;/span&gt;
&lt;span style="color: #008000"&gt;rem Download and install the Microsoft CAB SDK from &lt;/span&gt;
&lt;span style="color: #008000"&gt;rem http://support.microsoft.com/kb/310618 to c:\cabsdk&lt;/span&gt;
&lt;span style="color: #008000"&gt;rem *********************************************************** &lt;/span&gt;

&lt;span style="color: #008000"&gt;rem IMPORTANT: Set these values to your system. Do not include &lt;/span&gt;
&lt;span style="color: #008000"&gt;rem trailing slashes, and include values in quotes if necessary &lt;/span&gt;

&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; CABSDK_PATH=c:\cabsdk\bin
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; ROOT=C:\projects\projectname
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; TFS_USERNAME=&lt;span style="color: #006080"&gt;"domain\user.name"&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; TFS_PASSWORD=password 

&lt;span style="color: #008000"&gt;rem These should be relatively fixed&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; FORMS_ROOT=%ROOT%\Project.&lt;span style="color: #0000ff"&gt;Namespace&lt;/span&gt;\12\TEMPLATE\Layouts\infopathForms
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; XSD_ROOT=%ROOT%\Project.&lt;span style="color: #0000ff"&gt;Namespace&lt;/span&gt;\12\Resources
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; TF_PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE 

echo.
echo ********* InfoPath Form 1 *********
echo.
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; FORM_PATH=%FORMS_ROOT%\Form 1\Form1.xsn
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; XSD_PATH=%XSD_ROOT%\Form1.xsd
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; &lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt;=FINISH
&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; UPDATE_SCHEMA 

:FINISH
&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; FINISH_BATCH

:UPDATE_SCHEMA
echo Checking file out...
&lt;span style="color: #006080"&gt;"%TF_PATH%\tf.exe"&lt;/span&gt; edit &lt;span style="color: #006080"&gt;"%XSD_PATH%"&lt;/span&gt; 
    /login:%TFS_USERNAME%,%TFS_PASSWORD% /noprompt &amp;gt;/nil 

echo Extracting file...
del myschema.xsd
&lt;span style="color: #006080"&gt;"%CABSDK_PATH%\extract.exe"&lt;/span&gt; &lt;span style="color: #006080"&gt;"%FORM_PATH%"&lt;/span&gt; myschema.xsd &amp;gt;/nil 

echo Replacing file...
copy myschema.xsd &lt;span style="color: #006080"&gt;"%XSD_PATH%"&lt;/span&gt; &amp;gt;/nil 

echo Checking file &lt;span style="color: #0000ff"&gt;in&lt;/span&gt;...
&lt;span style="color: #006080"&gt;"%TF_PATH%\tf.exe"&lt;/span&gt; checkin &lt;span style="color: #006080"&gt;"%XSD_PATH%"&lt;/span&gt; 
    /login:%TFS_USERNAME%,%TFS_PASSWORD% /noprompt 
    /comment:&lt;span style="color: #006080"&gt;"Automated checkin from XsdExtractor script"&lt;/span&gt; &amp;gt;/nil 

&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; %&lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt;% 

:FINISH_BATCH 
&lt;/pre&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8395928" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/paulwhit/archive/tags/infopath/default.aspx">infopath</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/xsd/default.aspx">xsd</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/batch/default.aspx">batch</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/tfs/default.aspx">tfs</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/sharepoint/default.aspx">sharepoint</category></item><item><title>Live Writer: Word+Social media, for bloggers</title><link>http://blogs.msdn.com/paulwhit/archive/2008/04/15/live-writer-word-social-media-for-bloggers.aspx</link><pubDate>Tue, 15 Apr 2008 05:28:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8396099</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/8396099.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=8396099</wfw:commentRss><description>&lt;p&gt;I just started using &lt;a href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt; to update my blogs*. I'm thoroughly impressed with what I see, both from the practical sense and just how much cool seems to surround this thing.&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:84E294D0-71C9-4bd0-A0FE-95764E0368D9:139f9610-f244-4810-af46-774d25b85a3c" style="padding-right: 10px; display: inline; padding-left: 10px; float: right; padding-bottom: 10px; margin: 0px; padding-top: 10px"&gt;&lt;a href="http://maps.live.com/default.aspx?v=2&amp;amp;cp=qgkm0c8kdq18&amp;amp;lvl=1&amp;amp;style=o&amp;amp;scene=24019353&amp;amp;mkt=en-US&amp;amp;FORM=LLWR" id="map-e5f64010-9869-4f21-b6e8-b569b29f9841" alt="Click to view this map on Live.com" title="Click to view this map on Live.com"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/LiveWriterWordSocialmediaforbloggers_1367A/map-f75db1b8f557.jpg" width="320" height="240" alt="1) My Apartment Building, Washington, DC"&gt;&lt;/a&gt;&lt;br&gt;&lt;label for="map-e5f64010-9869-4f21-b6e8-b569b29f9841" style="font-size:.8em;"&gt;1) My Apartment Building, Washington, DC&lt;/label&gt;&lt;/div&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;Software+Services is Microsoft's answer to the debate about where the future of computing is going in the near future. My take on what this means is a badass WinForms interface with a sexy back-end built around some Web 2.0-ish stuff. That's the technical explanation.&lt;/p&gt; &lt;p&gt;Live Writer epitomizes all of this. It's a lightweight, feature- and graphics-rich editing environment, and it's very closely integrated with a bunch of "Web 2.0" sites, including a pile of blog packages and social media sites.&lt;/p&gt; &lt;p&gt;There are some neat plug-ins "out of the box", including one that took me exactly 12 seconds to show you an image of my apartment building (see image 1).&lt;/p&gt; &lt;p&gt;Plus, there seems to be an active plug-in community developing things to better pretty up source code, integrate with Flickr, Facebook and other sites. Some of em are crap, but the architecture seems like it must be easy enough to be accessible. One cool one is the Amazon Book Lookup plugin (see example below)&lt;/p&gt; &lt;p&gt;Some of the interface features I'm falling in love with include the ability to match the style to the blog's style (so I can switch between the three blogs and see how it'll look in each one), and the ability to pull up old posts from the "Open" menu.&lt;/p&gt; &lt;table align="right" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;a href="http://www.amazon.com/gp/redirect.html%3FASIN=1569245134%26tag=ws%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/1569245134%253FSubscriptionId=0525E2PQ81DD7ZTWTK82"&gt;&lt;img src="http://ecx.images-amazon.com/images/I/41VWH81G2KL._SL75_.jpg" border="1"&gt;&lt;/a&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;b&gt;Party of One: The Loners' Manifesto&lt;/b&gt; &lt;br&gt;by Anneli Rufus &lt;br&gt;&lt;br&gt;&lt;a href="http://www.amazon.com/gp/redirect.html%3FASIN=1569245134%26tag=ws%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/1569245134%253FSubscriptionId=0525E2PQ81DD7ZTWTK82"&gt;Read more about this book...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;* My blogs:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://geekswithblogs.net/paulwhitblog"&gt;My GeeksWithBlogs Blog&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/paulwhit"&gt;My MSDN Blog&lt;/a&gt;  &lt;li&gt;&lt;a href="http://paulw.us/blog"&gt;My Personal Blog&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8396099" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/paulwhit/archive/tags/tool/default.aspx">tool</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/livewriter/default.aspx">livewriter</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/blogging/default.aspx">blogging</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/socialnetwork/default.aspx">socialnetwork</category></item><item><title>Use the DescriptionAttribute with an Enum to display status messages.</title><link>http://blogs.msdn.com/paulwhit/archive/2008/03/31/use-the-descriptionattribute-with-an-enum-to-display-status-messages.aspx</link><pubDate>Tue, 01 Apr 2008 04:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346252</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/paulwhit/comments/8346252.aspx</comments><wfw:commentRss>http://blogs.msdn.com/paulwhit/commentrss.aspx?PostID=8346252</wfw:commentRss><description>&lt;div class="post"&gt; &lt;p&gt;&lt;font face="Arial"&gt;I've been working on various forms of displaying status messages from enums, and here's the latest preferred iteration of how to do this. Regurgitated and tweaked from &lt;a href="http://blog.waynehartman.com/articles/84.aspx"&gt;WayneHartman.com&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;enum&lt;/span&gt; XmlValidationResult
{
    [Description(&lt;span style="color: #006080"&gt;"Success."&lt;/span&gt;)]
    Success,
    [Description(&lt;span style="color: #006080"&gt;"Could not load file."&lt;/span&gt;)]
    FileLoadError,
    [Description(&lt;span style="color: #006080"&gt;"Could not load schema."&lt;/span&gt;)]
    SchemaLoadError,
    [Description(&lt;span style="color: #006080"&gt;"Form XML did not pass schema validation."&lt;/span&gt;)]
    SchemaError
}

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetEnumDescription(Enum &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)
{
    &lt;span style="color: #008000"&gt;// Get the Description attribute value for the enum value&lt;/span&gt;
    FieldInfo fi = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.GetType().GetField(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.ToString());
    DescriptionAttribute[] attributes = 
        (DescriptionAttribute[])fi.GetCustomAttributes(
            &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(DescriptionAttribute), &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);

    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (attributes.Length &amp;gt; 0)
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; attributes[0].Description;
    }
    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.ToString();
    }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It's possible to do something even cooler like &lt;a href="http://biasecurities.com/blog/2006/text-description-for-enum-values/"&gt;&lt;font color="#800080"&gt;cache the values&lt;/font&gt;&lt;/a&gt; or &lt;a href="http://blogs.msdn.com/abhinaba/archive/2005/10/21/483337.aspx"&gt;add a ToDescription() method&lt;/a&gt; (in C#3.0), but I just wanted an simple, repeatable way to do this.&lt;/p&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8346252" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/paulwhit/archive/tags/code/default.aspx">code</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/c_2300_/default.aspx">c#</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/enum/default.aspx">enum</category><category domain="http://blogs.msdn.com/paulwhit/archive/tags/.net/default.aspx">.net</category></item></channel></rss>