<?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>Scott Hunter</title><link>http://blogs.msdn.com/b/scothu/</link><description>ASP.NET and .NET Musings</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>HTML 5 Updates for .NET 4</title><link>http://blogs.msdn.com/b/scothu/archive/2011/08/10/html-5-updates-for-net-4.aspx</link><pubDate>Thu, 11 Aug 2011 05:49:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10194722</guid><dc:creator>Scott H</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=10194722</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2011/08/10/html-5-updates-for-net-4.aspx#comments</comments><description>&lt;p&gt;After we shipped .NET 4 we began working on the next version of the framework and one of the things that we have worked on for the next version of the framework is more support for HTML 5. We think that HTML 5 is so important that we have taken many of updates from the next framework and provided some of the most important ones as part of updates to .NET 4. This enables our customers to more easily develop HTML 5 applications now instead of waiting for the next framework. I’m going to highlight a couple of the updates and the major fixes they provide.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Update for the .NET Framework 4&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The first update was shipped with VS 2010 SP1. You can read about the framework update here: &lt;a title="http://support.microsoft.com/kb/2468871" href="http://support.microsoft.com/kb/2468871"&gt;http://support.microsoft.com/kb/2468871&lt;/a&gt;. One of the features of HTML 5 is there are now new input types such as date, url, email and more. While most browsers today don’t support these new input types you should still use them today because most mobile devices do support them and it changes the keyboard these devices display. For example specifying type=”email” will cause many phones to provide the “@” character on the keyboard. type=”email” or type=”url” will cause many phones to provide the “.com” button on the keyboard as a shortcut.&lt;/p&gt;  &lt;p&gt;Before the update above it was illegal to use these input types in Web Forms. The following would generate an error:&lt;/p&gt;  &lt;p&gt;&amp;lt;asp:TextBox id=”TextBoxEmail” runat=”server” type=”email” /&amp;gt;&lt;/p&gt;  &lt;p&gt;Because we were validating what values could be provided for the type= attribute. This validation was relaxed as part of the above update.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Reliability Update 1 for the .NET Framework 4&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Earlier this week on patch Tuesday another update was released called the reliability update 1 for .NET 4: &lt;a title="http://support.microsoft.com/kb/2533523" href="http://support.microsoft.com/kb/2533523"&gt;http://support.microsoft.com/kb/2533523&lt;/a&gt;. This update solves a variety of problems with HTML 5 input types. If you used any of the HTML 5 input types (a few mentioned above) with server controls they would not behave properly in the following cases:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;UpdatePanel&lt;/strong&gt; – The values of any HTML 5 input types would not be posted back on postback.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Validation Controls&lt;/strong&gt;&amp;#160; - The ASP.NET validation controls such as asp:RequiredFieldValidator would not provide client validation on HTML 5 input types.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Callbacks&lt;/strong&gt; – ASP.NET pages that are using callbacks would not post back the values of any HTML 5 input types.&lt;/p&gt;  &lt;p&gt;All of these items were corrected with the second update listed above. Even more support for HTML 5 will be coming in the next version of the framework and we hope to start announcing details around that soon. Note the above two updates also fix quite a few other things in .NET 4 as well so I suggest you read the details from the links.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10194722" width="1" height="1"&gt;</description></item><item><title>Update on the Microsoft jQuery Plugins</title><link>http://blogs.msdn.com/b/scothu/archive/2011/04/15/update-on-the-microsoft-jquery-plugins.aspx</link><pubDate>Fri, 15 Apr 2011 16:42:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10154549</guid><dc:creator>Scott H</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=10154549</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2011/04/15/update-on-the-microsoft-jquery-plugins.aspx#comments</comments><description>&lt;p&gt;A little over a six months ago we &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/10/04/jquery-templates-data-link-and-globalization-accepted-as-official-jquery-plugins.aspx"&gt;blogged&lt;/a&gt; about the work that Microsoft was doing with jQuery plugins (jQuery Templates, Globalization, and Data Link). This post provides a little more information on the current status and on the plans for those plugins.&lt;/p&gt;  &lt;p&gt;Over the past six months, as the jQuery and Microsoft teams have worked on the plugins, we've decided together that the richness and power of these plugins makes it important to develop them in the context of a strong relationship with a collaborative sub-team within jQuery. &lt;/p&gt;  &lt;p&gt;To facilitate this, the jQuery team has announced some changes in the way plugins are managed. Each plugin will now be owned by a sub-team within the jQuery Project, such as the jQuery UI team or the jQuery Core Dev team.&lt;/p&gt;  &lt;p&gt;When jQuery 1.5 shipped earlier this year, you might have wondered why jQuery Templates was not part of that release. The jQuery announcement clarifies this -- jQuery Templates is a key part of jQuery functionality, but it will nonetheless continue as a separate plugin in jQuery UI rather than shipping as part of jQuery Core. &lt;/p&gt;  &lt;p&gt;This is a continuation of the investment that Microsoft is making in jQuery and jQuery UI. Our investment isn't limited to the plugins I just mentioned. For example, another important investment has been the new jQuery UI Grid project that we've provided support for at many levels. We're now shipping both jQuery and jQuery UI in our newer products, and we plan to have great support in ASP.NET for developers who want to use the jQuery UI Grid in their projects.&lt;/p&gt;  &lt;p&gt;Moving forward, we'll continue to be involved in the design and development of jQuery Templates. This includes our contributions to the grid project, since the jQuery UI Grid is using the jQuery Templates plugin. Microsoft will also continue to work on Data Linking and its integration with jQuery Templates. We'll move that work to its own &lt;a href="https://github.com/BorisMoore/jsviews"&gt;source repository&lt;/a&gt;, plus we'll take ownership of the documentation.&lt;/p&gt;  &lt;p&gt;We think these changes are a valuable step towards helping the Microsoft and jQuery teams and the community to move these plugins towards RTM quality and to ship them as great V1 products!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10154549" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/jQuery/">jQuery</category></item><item><title>Updates to the Microsoft CDN (Updated 12/1/2010)</title><link>http://blogs.msdn.com/b/scothu/archive/2010/11/16/updates-to-the-microsoft-cdn.aspx</link><pubDate>Tue, 16 Nov 2010 17:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10092065</guid><dc:creator>Scott H</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=10092065</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2010/11/16/updates-to-the-microsoft-cdn.aspx#comments</comments><description>&lt;p&gt;I want to announce a couple of changes we have made to the Microsoft CDN recently.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Updated jQuery&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We have added both jQuery 1..4.3 and jQuery 1.4.4 to the CDN,&amp;nbsp; plus there are vsdoc files for both of these releases. These new releases are available with these URLs:&lt;/p&gt;
&lt;p&gt;jQuery version 1.4.4&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div align="left"&gt;&lt;a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js"&gt;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js&lt;/a&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div align="left"&gt;&lt;a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js"&gt;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js&lt;/a&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div align="left"&gt;&lt;a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js"&gt;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;jQuery version 1.4.3&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3.js"&gt;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3.js&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3.min.js"&gt;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3.min.js&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3-vsdoc.js"&gt;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3-vsdoc.js&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;New Domain Name&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Microsoft CDN is now available from a new domain name: ajax.aspnetcdn.com. We added support for this new domain name to increase the performance of the CDN. The primary benefit of the new domain is that it is not the microsoft.com domain, any requests to the microsoft.com cause the browser to send cookies for that domain across the wire. Since many people may have visited a Microsoft web property this means extra information is coming across the wire for those requests potentially slowing down the request. The new domain is a domain a user would never have visited in their browser and thus requests will have no additional payload. Testing has shown that this can increase speeds by up to 20%.&lt;/p&gt;
&lt;p&gt;The previous domain ajax.microsoft.com is still available and will always remain available so all links to it will continue to function as usual but going forward we recommend people use the new domain.&lt;/p&gt;
&lt;p&gt;Full details of the Microsoft CDN are available here: &lt;a href="http://www.asp.net/ajaxlibrary/cdn.ashx" title="http://www.asp.net/ajaxlibrary/cdn.ashx"&gt;http://www.asp.net/ajaxlibrary/cdn.ashx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SSL Support (12/1/2010)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When we first created the new CDN ajax.aspnetcdn.com it did not support SSL (https://) style requests. As of 12/1/2010 the CDN has been updated to support SSL as well now.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10092065" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category></item><item><title>Web Pages Beta 2–Request Validation</title><link>http://blogs.msdn.com/b/scothu/archive/2010/10/06/web-pages-beta-2-request-validation.aspx</link><pubDate>Thu, 07 Oct 2010 05:09:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10072566</guid><dc:creator>Scott H</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=10072566</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2010/10/06/web-pages-beta-2-request-validation.aspx#comments</comments><description>&lt;p&gt;Today we released all kinds of goodness at Microsoft for ASP.NET developers:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;- Web Pages Beta 2 – An update to our new support for adding simple Razor syntax pages to to web applications. &lt;/li&gt;    &lt;li&gt;- MVC 3 Beta – An update to our preview release from a few months ago with several enhancements around razor, helpers, unobtrusive javascript, dependency injection and more. &lt;/li&gt;    &lt;li&gt;- NuPack – Package manager for finding, adding, upgrading libraries for your .NET projects. This makes it super easy to find libraries for writing your applications and easily installing them into your projects including their dependencies. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I want to focus on Web Pages today which I’ve not written about since we released the first release but I’ve been involved in from the beginning. If you don’t have any background on Web Pages this is a very simple way to do web development drawling parallels to programming in classic ASP or PHP. It does not require development tools like Visual Studio, or a build system to build projects. You can just take an empty folder and and drop in a .cshtml (C#)or .vbhtml (Visual Basic) file into the folder that contains a combination of markup and razor syntax and point your browser and you are off and running.&lt;/p&gt;  &lt;p&gt;For someone like myself Web Pages reminds me of when I first started web programming years ago with classic ASP. I could take my HTML files and add a little bit of inline code to get dynamic web pages. It was a great way to learn web programming and Web Pages brings this same simplicity to ASP.NET. All of the concepts you learn while programming in Web Pages you should be able to use if you decide to move up to our more complicated frameworks like MVC.&lt;/p&gt;  &lt;p&gt;To learn more about Web Pages check out our online manual: &lt;a title="http://www.asp.net/webmatrix/tutorials/1-getting-started-with-webmatrix-and-asp-net-web-pages" href="http://www.asp.net/webmatrix/tutorials/1-getting-started-with-webmatrix-and-asp-net-web-pages"&gt;http://www.asp.net/webmatrix/tutorials/1-getting-started-with-webmatrix-and-asp-net-web-pages&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Today I’m going to talk about Request Validation which is a security feature that is built in ASP.NET. Request Validation is a security measure that is built into ASP.NET. The purpose of this feature is prevent script or HTML injection attack in websites. Such attacks happen when a webpage has some input fields on the page that accept input. If a person fills these input fields with script or html and the web page outputs the content back the user the web browser will run the script or html potentially causing the browser to do something bad.&lt;/p&gt;  &lt;p&gt;To prevent this ASP.NET looks at any input that it sees and if it looks like unencoded html and error will happen and the request will not be processed. Lets take a simple application and see what this looks like:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: #800000"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: #ff0000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&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;lang&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&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;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000"&gt;charset&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;utf-8&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&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;&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;br /&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;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt; &lt;span style="color: #ff0000"&gt;method&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;post&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;action&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;for&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;description&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Description:&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;label&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;textarea&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;description&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;textarea&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;br&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;input&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Submit&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;br&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        @if (IsPost) {&lt;br /&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;br /&gt;                Your description is: @Request[&amp;quot;description&amp;quot;]&lt;br /&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;br /&gt;        }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&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: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;If I type something in the field on the page that looks like html:&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/7357.image_5F00_4A5A5102.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/3323.image_5F00_thumb_5F00_6139227E.png" width="527" height="202" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;And the press the submit button I will get an error instead of having my page run properly:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/5710.image_5F00_072ED2D5.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/3731.image_5F00_thumb_5F00_34AFF298.png" width="529" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows an example of ASP.NET working to be secure by default and making the developer make the decision if they want allow such input. You might be asking yourself why would you want to allow someone to type html into a field. The best example is when you build a web page that contains a rich html editor, today you see these in all kinds of applications on the internet such as blogs. I’ve added the TinyMCE editor to my application because I want to have a rich editor. I downloaded the scripts from the TinyMCE site and added them to the scripts folder in my project. Next I added the following markup above my form:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&amp;lt;script type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; src=&lt;span style="color: #006080"&gt;&amp;quot;scripts/tiny_mce/tiny_mce.js&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&lt;span style="color: #006080"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;    tinyMCE.init({&lt;br /&gt;        mode : &lt;span style="color: #006080"&gt;&amp;quot;textareas&amp;quot;&lt;/span&gt;,&lt;br /&gt;        theme : &lt;span style="color: #006080"&gt;&amp;quot;simple&amp;quot;&lt;/span&gt;&lt;br /&gt;    });&lt;br /&gt;&amp;lt;/script&amp;gt;        &lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;This enables the rich html editor on my page and running the page in the browser now looks like this: 
  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/3644.image_5F00_65CF2D38.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/4237.image_5F00_thumb_5F00_6C8236BB.png" width="519" height="367" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now any in the description field will fail with the same server error we saw above when pressing the submit button. This is because the fancy effects of being able to bold, strike through and underline you see in the example above happen because the field contains html. I need someway of turning off the validation for just this one field. Older versions of ASP.NET have had ways of turning this off:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ASP.NET 1.1 – ASP.NET 3.5 SP1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Web Forms you can add the following page directive: &amp;lt;%@ Page validateRequest=&amp;quot;false&amp;quot; %&amp;gt;&lt;/p&gt;

&lt;p&gt;In MVC you would place the following attribute on the action method for your controller: [ValidateInput(false)]&lt;/p&gt;

&lt;p&gt;But these are not a good solution because they turn off Request Validation for the entire page! If I had other fields on the page for example a &amp;lt;input type=”text” name=”name”/&amp;gt; field in which I do not want to allow html or script input it is no longer protected because I’ve turned off request validation for the whole page. Now I need to manually validate the input for each field to make sure the input is safe.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ASP.NET 4:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We made Request Validation even stronger by making it happen earlier in the request pipeline. This meant that even low level ASP.NET components called Handlers and Modules could be protected. But because we are validating input so early you can no longer turn it on or off at the page level. If you had pages that needed to support html input you had to disable the .NET 4 mode and re-enable the .NET 1.1/2.0 mode using settings in the web.config file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Future: Web Pages, MVC 3 and in the next framework Web Forms:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clearly we needed a much better solution. I should be able to turn off the request validation just for the fields that need to support html type input. While building Web Pages we were able to keep both the additional security we enabled in .NET 4 and support this using the new Validation.Exclude method. Here is how I add support for this by adding it to the top of my page:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;@{&lt;br /&gt;    Validation.Exclude(&lt;span style="color: #006080"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;);&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;You can pass multiple fields or if you want to disable Request Validation for the entire page you can call Validation.ExcludeAll. Now if I run the page in the browser you will see this:&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/0511.image_5F00_212292F7.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/8358.image_5F00_thumb_5F00_2BDFEA4C.png" width="506" height="289" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;You might be asking yourself why does the text in the rich html editor look one way and when I display in the page does it look different? We have just run into another security feature that ASP.NET razor syntax has, whenever we output values we automatically encode them:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;Your description &lt;span style="color: #0000ff"&gt;is&lt;/span&gt;: @Request[&lt;span style="color: #006080"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;]&lt;br /&gt;&lt;/pre&gt;
The value of @Request[“description”] is automatically html encoded. This again is an example of security being on by default so if values containing html or script are output the browser will not execute the html/script. If the developer knows that the data they are outputing is valid they can create a special type called an HtmlString and return the value of that which will not be automatically encoded. Here is&amp;#160; the changed code in my sample:&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #cc6633"&gt;@if&lt;/span&gt; (IsPost) {&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; desc = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; HtmlString(Request[&lt;span style="color: #006080"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;]);&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;        Your description &lt;span style="color: #0000ff"&gt;is&lt;/span&gt;: &lt;span style="color: #cc6633"&gt;@desc&lt;/span&gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;Now I’m grabbing the value of the Request and creating a new HtmlString with that value. HtmlString is a special type that ASP.NET does not encode when it is output. Now running my page I will get the output I expect:&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/0842.image_5F00_24547ADF.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/6864.image_5F00_thumb_5F00_2B078462.png" width="326" height="355" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;In this blog post I’ve covered a lot of topics but to recap:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;- Web Pages validates input by default for security &lt;/li&gt;

  &lt;li&gt;- Web pages allows this validation to be disabled on a field by field basis &lt;/li&gt;

  &lt;li&gt;- Web pages encodes output by default for security &lt;/li&gt;

  &lt;li&gt;- Web pages allows output to be put into an HtmlString which allows it to be output with encoding &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope to post about more Web Pages features soon…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10072566" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Web+Pages/">Web Pages</category></item><item><title>GridView with Sort Arrows and Showing Header When Empty</title><link>http://blogs.msdn.com/b/scothu/archive/2010/08/28/gridview-with-sort-arrows-and-showing-header-when-empty.aspx</link><pubDate>Sun, 29 Aug 2010 02:02:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10055441</guid><dc:creator>Scott H</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=10055441</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2010/08/28/gridview-with-sort-arrows-and-showing-header-when-empty.aspx#comments</comments><description>&lt;p&gt;One of the common things people want to do when displaying data with grid controls is to have the little up and down arrows next to the header columns to indicated what direction the data is being sorted in. You see this in Windows Explorer and many other programs. This has been traditionally something that is difficult to do with the GridView control in ASP.NET. If you search the internet you will find a variety of hacks to do this:&lt;/p&gt;  &lt;p&gt;Matt Berseth: &lt;a href="http://mattberseth.com/blog/2008/04/building_a_vs2008_styled_grid_1.html" target="_blank"&gt;Building a VS2008 Styled Grid with the GridView Control&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4 Guys From From Rolla.com: &lt;a href="http://www.4guysfromrolla.com/articles/020608-1.aspx" target="_blank"&gt;Improving the Sort Arrows GridView Control&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Some of these implementations have various limitations such as they don’t work if you use AutoGenerateColumns = true. In .NET 4 we addressed these problems by adding a couple of new properties to the GridView:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sortedascendingheaderstyle.aspx" target="_blank"&gt;&amp;lt;SortedAscendingHeaderStyle /&amp;gt;&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sorteddescendingheaderstyle.aspx" target="_blank"&gt;&amp;lt;SortedDescendingHeaderStyle /&amp;gt;&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sortedascendingcellstyle.aspx" target="_blank"&gt;&amp;lt;SortedAscendingCellStyle /&amp;gt;&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sorteddescendingcellstyle.aspx" target="_blank"&gt;&amp;lt;SortedDescendingCellStyle /&amp;gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;These allow you to easily set specific styles on both the header cells and the item cells of the GridView. Here is an example of this put to use in a GridView:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;asp:GridView ID=&lt;span style="color: #006080"&gt;&amp;quot;GridView1&amp;quot;&lt;/span&gt; runat=&lt;span style="color: #006080"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; AllowSorting=&lt;span style="color: #006080"&gt;&amp;quot;True&amp;quot;&lt;/span&gt; DataSourceID=&lt;span style="color: #006080"&gt;&amp;quot;EntityDataSource1&amp;quot;&lt;/span&gt; PageSize=&lt;span style="color: #006080"&gt;&amp;quot;5&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     &amp;lt;SortedAscendingHeaderStyle CssClass=&lt;span style="color: #006080"&gt;&amp;quot;sortasc&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &amp;lt;SortedDescendingHeaderStyle CssClass=&lt;span style="color: #006080"&gt;&amp;quot;sortdesc&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &amp;lt;/asp:GridView&amp;gt;&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;What this does in when the grid is being sorted the header of the grid the sortasc or sortdesc class will be applies to the header cell like this depending on the direction it is being sorted on:&lt;/p&gt;

&lt;p&gt;&amp;lt;th style=”sortasc”&amp;gt;Column Header&amp;lt;/th&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;th style=”sortdesc”&amp;gt;Column Header&amp;lt;/th&amp;gt;&lt;/p&gt;

&lt;p&gt;And I’ve got some simple CSS defined that will apply a sort arrow:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; th.sortasc a  &lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     display:block; padding:0 4px 0 15px; &lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     background:url(img/asc.gif) no-repeat;  &lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; th.sortdesc a &lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     display:block; padding:0 4px 0 15px; &lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     background:url(img/desc.gif) no-repeat;&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The end result will look like this showing the grid sorting each direction on the LastName column with nice arrows showing the direction.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/1030.image_5F00_0FDBC559.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/8284.image_5F00_thumb_5F00_79397711.png" width="192" height="244" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/3482.image_5F00_2DD9D34D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/4075.image_5F00_thumb_5F00_1F9B5A5D.png" width="192" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve created a sample of this you can download and try out: &lt;a href="http://www.cshonline.com/aspnet/gridsortarrows.zip" target="_blank"&gt;http://www.cshonline.com/aspnet/gridsortarrows.zip&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Another common request for the GridView deals with how it displays when there is no data. It basically does not display at all. You will basically see a set of empty &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt; tags in the page. There is a template inside the Grid that you can use to display some text:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;EmptyDataTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     Empty GridView&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;EmptyDataTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;But a lot of the time what you really want is to display the header row of the Grid showing what &lt;strong&gt;COULD&lt;/strong&gt; be displayed. Once again if you search around the Internet you might find hacks to show the header. Once again because this was a common ask we added support for this in .NET 4. You can now use the ShowHeaderWhenEmpty property to show the header. Here is what the markup would look like:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;asp:GridView ID=&lt;span style="color: #006080"&gt;&amp;quot;GridView1&amp;quot;&lt;/span&gt; runat=&lt;span style="color: #006080"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; DataSourceID=&lt;span style="color: #006080"&gt;&amp;quot;EntityDataSource1&amp;quot;&lt;/span&gt; ShowHeaderWhenEmpty=&lt;span style="color: #006080"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--crlf--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &amp;lt;/asp:GridView&amp;gt;&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And here is what a GridView would display with no data with this property enabled:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/4578.image_5F00_264E63E0.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/8875.image_5F00_thumb_5F00_2D016D63.png" width="244" height="206" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hopefully all of these new options will make using the GridView easier. Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10055441" width="1" height="1"&gt;</description></item><item><title>PersistedSelection in Data Controls in .NET 4</title><link>http://blogs.msdn.com/b/scothu/archive/2010/08/26/persistedselection-in-data-controls-in-net-4.aspx</link><pubDate>Fri, 27 Aug 2010 04:55:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10054880</guid><dc:creator>Scott H</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=10054880</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2010/08/26/persistedselection-in-data-controls-in-net-4.aspx#comments</comments><description>&lt;p&gt;We did a variety of small feature items across the data controls when we were working on .NET 4 and I’m going to do a couple of blog posts on some of this new functionality. When we were building Dynamic Data we made small enhancements to the data controls but they only worked when you were using Dynamic Data. In .NET 4 we took this functionality and made it work across all of our core data controls.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Persisted Selection&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When using our data controls that support paging like GridView and ListView there is some funky behavior today. If the user selects the first row of data and then moves to the next page the first row of the data is selected. This behavior seems weird, especially when you are in a master detail scenario where you show the details of the selected row on the same page. As you page through your data the detail view would keep changing as you move from page to page. Here is what the old behavior looks like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/1856.image_5F00_402BADE3.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/0702.image_5F00_thumb_5F00_2BC5E858.png" width="284" height="225" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;You can see in the first image that the second row is selected.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/2043.image_5F00_048B9F23.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/8132.image_5F00_thumb_5F00_0B3EA8A6.png" width="286" height="227" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;As I move to the second page the second row which is a different user is selected. This is probably not what a user would expect when using the controls. Now I’m going to enable a new property on the control called EnablePersistedSelelection and set it to true.&lt;/p&gt;    &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; EnablePersistedSelection=&lt;span style="color: #006080"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And now we can look and see what the behavior looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/2330.image_5F00_11F1B229.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/0218.image_5F00_thumb_5F00_18A4BBAC.png" width="230" height="244" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;

&lt;p&gt;You can now see that I select Scott Hunter in the first page. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/2450.image_5F00_716A7276.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/2043.image_5F00_thumb_5F00_632BF986.png" width="230" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And move to the second page and no row is selected.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/8132.image_5F00_50E332C4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-95-25-metablogapi/8625.image_5F00_thumb_5F00_57963C47.png" width="230" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;but moving back to the first page Scott Hunter is still selected. This should make master / detail view work better we think this is the behavior that someone would expect when using the control anyways.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10054880" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/WebForms/">WebForms</category></item><item><title>Automatically prepopulate fields for Insert in .NET 4</title><link>http://blogs.msdn.com/b/scothu/archive/2010/08/26/automatically-prepopulate-fields-for-insert-in-net-4.aspx</link><pubDate>Thu, 26 Aug 2010 07:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10054504</guid><dc:creator>Scott H</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=10054504</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2010/08/26/automatically-prepopulate-fields-for-insert-in-net-4.aspx#comments</comments><description>&lt;p&gt;We introduced a lot of little data enhancements in .NET 4 that you may not have heard about. One of these is a mechanism for setting the default value of fields in a data control when you want to do an Insert. In our controls today you would probably do something painful:&lt;/p&gt;
&lt;p&gt;- Handle the ItemCreated event and inside the event you can call FindControl and find the control for each column manually and set the value on the control using whatever property it supports to set its control.&lt;/p&gt;
&lt;p&gt;- Handle the Inserting event on the data source control (if you are using one) and check to see if fields have values and if not set the default. This is problematic because this happens after the user has pressed Insert so they do not see the default value until AFTER the insert operation.&lt;/p&gt;
&lt;p&gt;One of the features we enabled in .NET 4 was the ability to enable Dynamic Data functionality with a single line of code in an existing web page. By enabling Dynamic Data you can easily use some of its features to make this super simple.&lt;/p&gt;
&lt;p&gt;In my example I&amp;rsquo;ve got a table called Contact which has an Id, FirstName, LastName and Age fields. I&amp;rsquo;ve created an Entity Framework model around my database giving me rich classes for the tables in my database. Here is what my page markup looks like:&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:DetailsView&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="DetailsView1"&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: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="50px"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="125px"&lt;/span&gt; &lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;     &lt;span style="color: #ff0000"&gt;AutoGenerateRows&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="True"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataKeyNames&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Id"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DataSourceID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="EntityDataSource1"&lt;/span&gt; &lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #ff0000"&gt;DefaultMode&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Insert"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Fields&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:CommandField&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ShowInsertButton&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="True"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Fields&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:DetailsView&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:EntityDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="EntityDataSource1"&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: #ff0000"&gt;ConnectionString&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="name=DatabaseEntities"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultContainerName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="DatabaseEntities"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;EnableFlattening&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="False"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;EnableInsert&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="True"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;EntitySetName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Contacts"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:EntityDataSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And here is what my code behind markup looks like:&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; DetailsView1.EnableDynamicData(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(DatabaseModel.Contact));&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; var contact = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DatabaseModel.Contact();&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt; contact.FirstName = &lt;span style="color: #006080"&gt;"Scott"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; contact.LastName = &lt;span style="color: #006080"&gt;"Guthrie"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; DetailsView1.SetMetaTable(DetailsView1.GetMetaTable(), contact);&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;My code is doing a couple of items here:&lt;/p&gt;
&lt;p&gt;1: Enabling Dynamic Data functionality for the data control passing it the type of data the control is hosting. This is the object from my Entity Framework model.&lt;/p&gt;
&lt;p&gt;2 &amp;ndash; 4: Creating a dummy record of Contact and filling in the fields with whatever data I want to use for my defaults.&lt;/p&gt;
&lt;p&gt;5: Calling the SetMetaTable method on the data control passing the MetaTable which I get from the GetMetaTable method on the control and then passing my object that contains the default values.&lt;/p&gt;
&lt;p&gt;Now if I run my page I will get the DetailsView to show up with my defaults automatically set. Note in my example I&amp;rsquo;m using auto generated columns. If you choose to manually specify your columns you will need to specify them using either DynamicField (DetailsView/GridView) or DynamicControl (FormView/ListView) for this functionality to work because these types inject Dynamic Data fields templates which allow this insert functionality to work.&lt;/p&gt;
&lt;p&gt;Also you can also specify the defaults using a dictionary if you don&amp;rsquo;t want to create a full object. Here is an example of what that would look like:&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; DetailsView1.EnableDynamicData(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(DatabaseModel.Contact));&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; var contact = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;&amp;gt;() {&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     {&lt;span style="color: #006080"&gt;"FirstName"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"Scott"&lt;/span&gt;},&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;span style="color: #006080"&gt;"LastName"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"Guthrie"&lt;/span&gt;}&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; };&lt;/pre&gt;
&lt;!--crlf--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; DetailsView1.SetMetaTable(DetailsView1.GetMetaTable(), contact);&lt;/pre&gt;
&lt;!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/!--crlf--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I&amp;rsquo;ve created a fully running sample of this you can download as well. The sample requires .NET 4, VS 2010 and SQL Express 2008 to be installed to run. Here is the link the sample: &lt;a href="http://www.cshonline.com/aspnet/insertdefaults.zip"&gt;http://www.cshonline.com/aspnet/insertdefaults.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10054504" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Dynamic+Data/">Dynamic Data</category></item><item><title>Program Manager Position on the ASP.NET PM team</title><link>http://blogs.msdn.com/b/scothu/archive/2009/11/23/program-manager-position-on-the-asp-net-pm-team.aspx</link><pubDate>Mon, 23 Nov 2009 22:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927588</guid><dc:creator>Scott H</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9927588</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2009/11/23/program-manager-position-on-the-asp-net-pm-team.aspx#comments</comments><description>&lt;P&gt;Are you interested in making a change? Do you want to join a fast moving team inside of Microsoft and help drive the future features in ASP.NET?We have a program manager position on the ASP.NET team which is currently available. You can access the listing here: &lt;A href="https://careers.microsoft.com/JobDetails.aspx?ss=&amp;amp;pg=0&amp;amp;so=&amp;amp;rw=1&amp;amp;jid=9482&amp;amp;jlang=EN" mce_href="https://careers.microsoft.com/JobDetails.aspx?ss=&amp;amp;pg=0&amp;amp;so=&amp;amp;rw=1&amp;amp;jid=9482&amp;amp;jlang=EN"&gt;ASP.NET PM Position&lt;/A&gt;. We are looking for someone that is interested in driving the data strategy on our team which includes partnering with LINQ and SQL teams, is into web standards around HTML, CSS and JavaScript and making ASP.NET work better with these standards and much much more. Please check out the listing if you are interested.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9927588" width="1" height="1"&gt;</description></item><item><title>Data Enhancements in .NET 4 / Visual Studio 2010 Beta 2</title><link>http://blogs.msdn.com/b/scothu/archive/2009/10/20/data-enhancements-in-net-4-visual-studio-2010-beta-2.aspx</link><pubDate>Wed, 21 Oct 2009 06:40:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9910385</guid><dc:creator>Scott H</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9910385</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2009/10/20/data-enhancements-in-net-4-visual-studio-2010-beta-2.aspx#comments</comments><description>&lt;p&gt;On Wednesday we are releasing .NET 4 / Visual Studio 2010 Beta 2 to the public and&amp;#160; it brings many cool enhancements to the ASP.NET data controls and Entity Framework. I’m going to drill into a few features of these data related features and you can read more about all the changes to ASP.NET 4 at: &lt;a title="http://www.asp.net/learn/whitepapers/aspnet40/" href="http://www.asp.net/learn/whitepapers/aspnet40/"&gt;http://www.asp.net/learn/whitepapers/aspnet40/&lt;/a&gt;. This contains a very detailed list of all the changes we have made in ASP.NET.&lt;/p&gt;  &lt;p&gt;Here are a couple of my favorite “data” related features:&lt;/p&gt;  &lt;p&gt;1) The Entity Framework now supports the ability to the ability to pluralize entity sets and singularize entities. This means when I refer the table the table will be called “Products” but the actual class that I work on in my application is a “Product”. This feels much more natural then Entity Framework 1 where I would write:&lt;/p&gt;  &lt;p&gt;Products product = new Products();&lt;/p&gt;  &lt;p&gt;while in 4.0 this becomes:&lt;/p&gt;  &lt;p&gt;Product product = new Product();&lt;/p&gt;  &lt;p&gt;which feels more natural and looks better in my code.&lt;/p&gt;  &lt;p&gt;Here is the UI in the Entity Model Wizard for enabling this (note it turned on by default)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/scothu/WindowsLiveWriter/DataEnhancemen.NET4VisualStudio2010Beta2_14CDC/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/scothu/WindowsLiveWriter/DataEnhancemen.NET4VisualStudio2010Beta2_14CDC/image_thumb.png" width="244" height="66" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;2) The Entity Framework now supports the ability to include “foreign keys” in the data model. In version 1 of the Entity Framework if I had a Product table that contained a CategoryID which referenced a record in the Category table the generated Entity Framework model would convert the CategoryID into a navigation property which would drill directly in the category table. While this simplified some scenario’s it made web scenarios more difficult. Normally I would represent the this in using a DropDownList control which would contain the primary key and the name of the records from the category table. When saving saving the record I would just want to assign the selected CategoryID from the DropDownList to the Product class. But with navigation properties I would have to revert to some very ugly and non-discoverable code for setting the CategoryID since it not exist. Entity Framework 4 now includes the ability to have foreign key columns added directly to the entity allowing me to either set the foreign key or the navigation property making web scenarios easier to program:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/scothu/WindowsLiveWriter/DataEnhancemen.NET4VisualStudio2010Beta2_14CDC/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/scothu/WindowsLiveWriter/DataEnhancemen.NET4VisualStudio2010Beta2_14CDC/image_thumb_1.png" width="124" height="244" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/scothu/WindowsLiveWriter/DataEnhancemen.NET4VisualStudio2010Beta2_14CDC/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/scothu/WindowsLiveWriter/DataEnhancemen.NET4VisualStudio2010Beta2_14CDC/image_thumb_2.png" width="110" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; EF 1.0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; EF 4.0&amp;#160; &lt;/p&gt;  &lt;p&gt;3) QueryExtender support is now available for EntityDataSource. In .NET 4 Beta 1 and in the Dynamic Data Preview releases on CodePlex we introduced a very exciting extender control for the LinqDataSource called the QueryExtender. We created this control in response to feedback we received after releasing Dynamic Data 1.0 that our customers wanted an easy way of filtering or searching the data that their data source controls returned aka “How do I implement a search”. This pattern with data source controls can get fairly complicated and we wanted to provide something simple. The QueryExtender allows the following types of searches:&lt;/p&gt;  &lt;p&gt;Search: Searched for a string across any number of columns&lt;/p&gt;  &lt;p&gt;Range: Filters data based on if the value of a column is between a given range&lt;/p&gt;  &lt;p&gt;Property: Filters based on a column matching a value &lt;/p&gt;  &lt;p&gt;Custom: Event is fired in which the developer can customize the LINQ expression.&lt;/p&gt;  &lt;p&gt;Here is an example of using the QueryExtender with the EntityDataSource. It takes the value from TextBox1 and uses compares it to the ProductName field and only returns rows which have the text from TextBox1 in the ProductName field:&lt;/p&gt;  &lt;p&gt;&amp;lt;asp:EntityDataSource ID=&amp;quot;EntityDataSource1&amp;quot; runat=&amp;quot;server&amp;quot;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ConnectionString=&amp;quot;name=NORTHWNDEntities&amp;quot;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DefaultContainerName=&amp;quot;NORTHWNDEntities&amp;quot; EnableDelete=&amp;quot;True&amp;quot;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; EnableFlattening=&amp;quot;False&amp;quot; EnableInsert=&amp;quot;True&amp;quot; EnableUpdate=&amp;quot;True&amp;quot;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; EntitySetName=&amp;quot;Products&amp;quot;&amp;gt;    &lt;br /&gt;&amp;lt;/asp:EntityDataSource&amp;gt;    &lt;br /&gt;&lt;strong&gt;&amp;lt;asp:QueryExtender ID=&amp;quot;QueryExtender1&amp;quot; runat=&amp;quot;server&amp;quot; TargetControlID=&amp;quot;EntityDataSource1&amp;quot;&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:SearchExpression SearchType=&amp;quot;Contains&amp;quot; DataFields=&amp;quot;ProductName&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:ControlParameter ControlID=&amp;quot;TextBox1&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/asp:SearchExpression&amp;gt;      &lt;br /&gt;&amp;lt;/asp:QueryExtender&amp;gt; &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;4) EnableDynamicData extension method. We introduced Dynamic Data in .NET 3.5 SP1 but it put some serious demands on the developer: Required the developer to be using Linq to SQL or Entity Framework, Required the developer to start a new project to get the Dynamic Data support files, Provided a different programming model. With Beta 2 we have added this new feature which can be enabled on our data controls like this:&lt;/p&gt;  &lt;p&gt;ListView1.EnableDynamicData(typeofProduct))&lt;/p&gt;  &lt;p&gt;This one line of code will automatically bring many of the features that Dynamic Data provides:&lt;/p&gt;  &lt;p&gt;- Automatic validation&lt;/p&gt;  &lt;p&gt;- Support for Data Annotations on objects to control validation and display properties&lt;/p&gt;  &lt;p&gt;- Support for field templates for customizing UI behavior based on data type&lt;/p&gt;  &lt;p&gt;This should allow any developer to utilize the power of Dynamic Data without radically changing their application or requiring Linq to SQL or Entity Framework.&lt;/p&gt;  &lt;p&gt;There are many other changes and updates to our data support and I will try and blog about it over the next few weeks.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9910385" width="1" height="1"&gt;</description></item><item><title>Dynamic Data Preview 4 Released</title><link>http://blogs.msdn.com/b/scothu/archive/2009/05/07/dynamic-data-preview-4-released.aspx</link><pubDate>Thu, 07 May 2009 11:29:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9593141</guid><dc:creator>Scott H</dc:creator><slash:comments>16</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9593141</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2009/05/07/dynamic-data-preview-4-released.aspx#comments</comments><description>&lt;p&gt;Today we released the newest preview release of Dynamic Data. You can view the details and download this release from here: &lt;a title="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27026" href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27026"&gt;http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27026&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The preview releases of Dynamic Data contain much of the new feature sets that will be available when we release .NET 4. The cool thing is you can start using a lot of the new features against .NET 3.5 SP1 now using these releases.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;When we look back and see how people view Dynamic Data we regret that people immediately think of it as scaffolding of data. This is something that it does do, and I think it does a pretty good job at it. But Dynamic Data is a lot more then that, providing a new templating mechanism called Field Templates which allow the default markup for many of our built in data controls to be more easily customized. These field templates also support validation by default (something our rich data controls did not) which can be customized by adding metadata to data objects.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In the past to enable Dynamic Data functionality in a web application the application needed to follow a couple of rules:&lt;/p&gt;  &lt;p&gt;- It had to have a data model such as Entity Framework or Linq to SQL&lt;/p&gt;  &lt;p&gt;- The data model had to be registered at startup in Global.asax&lt;/p&gt;  &lt;p&gt;- The DynamicData directory had to exist in the web application&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;One of the new features this new preview release supports is adding field templates and validation to any ASP.NET web page without having to meet these requirements. It is as simple as:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;GridView1.EnableDynamicData(typeof(Product));&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What does this do for you? Today a control like GridView supports all kinds of high level features such as paging, sorting, viewing, editing but it provides no validation of data at all. So if your database has an integer field the end user would be able to type any data they wanted and when saving the record an ASP.NET yellow screen of death screen would appear (on the development box) saying that the data could not be converted to an integer. By enabling Dynamic Data automatic validation will occur because validation is built into the field templates that would render the column and a nice error message will appear in the page saying “Field XYZ must be an integer”.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To see this in action download the preview release and try out the SimpleDynamicDataSample.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9593141" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Dynamic+Data/">Dynamic Data</category></item><item><title>ASP.NET 4.0 and Visual Studio 2010 Development Overview &amp;amp; Dynamic Data</title><link>http://blogs.msdn.com/b/scothu/archive/2009/03/23/asp-net-4-0-and-visual-studio-2010-development-overview-dynamic-data.aspx</link><pubDate>Mon, 23 Mar 2009 18:47:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9501609</guid><dc:creator>Scott H</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9501609</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2009/03/23/asp-net-4-0-and-visual-studio-2010-development-overview-dynamic-data.aspx#comments</comments><description>&lt;p&gt;Last week at the Mix conference in Las Vegas we released a whitepaper that contain a list of many of the items that we are adding to ASP.NET 4.0 and Visual Studio 2010. The paper provides an overview of what we expect to be in the first beta release (do not ask for timeframes as we do not have a published date yet). You can view the whitepaper here in both HTML and download form: &lt;a title="http://www.asp.net/learn/whitepapers/aspnet40/" href="http://www.asp.net/learn/whitepapers/aspnet40/"&gt;http://www.asp.net/learn/whitepapers/aspnet40/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Lasr week we also released a new preview of Dynamic Data. You can download the preview 3 of Dynamic Data from this link: &lt;a title="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24887" href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24887"&gt;http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24887&lt;/a&gt;. This preview really rocks and contains the QueryBlockExtender mentioned in the whitepaper above it also includes a new DomainDataSouce for accessing business layers that are created from the new .NET RIA Services CTP that was also released at Mix. Check it out and I hope to blog on it soon.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Today I will be speaking at DevConnection in Orlando, FL on Data Access and WebForm improvements in 4.0. If you are at the show the two talks are:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;2pm: AMS06: ASP.NET 4.0 Data Access Patterns for Success with Web Forms&lt;/p&gt;  &lt;p&gt;3:45: AMS08: ASP.NET Web Forms 4.0&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Hope to see you there!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9501609" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Dynamic+Data/">Dynamic Data</category></item><item><title>Better support for 3rd party controls and Dynamic Data in ASP.NET 4.0 and DevExpress Grid and Dynamic Data</title><link>http://blogs.msdn.com/b/scothu/archive/2009/03/10/better-support-for-3rd-party-controls-and-dynamic-data-in-asp-net-4-0-and-devexpress-grid-and-dynamic-data.aspx</link><pubDate>Tue, 10 Mar 2009 11:50:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9468830</guid><dc:creator>Scott H</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9468830</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2009/03/10/better-support-for-3rd-party-controls-and-dynamic-data-in-asp-net-4-0-and-devexpress-grid-and-dynamic-data.aspx#comments</comments><description>&lt;p&gt;One of the things that we worked on supporting in Dynamic Data is the ability for third party controls like Grids to be able to host DynamicControls. Basically allowing the developer to use controls that are fancier or have more features then the stock controls in ASP.NET with Dynamic Data.&lt;/p&gt;  &lt;p&gt;For the first version of Dynamic Data we tried we ran into various limitations because it was delivered in a service pack which limited what type of changes we could make in the framework. Basically we were able to add new API’s but had little ability to change existing API’s.&lt;/p&gt;  &lt;p&gt;One of the limitations this placed on controls was that to support Dynamic Data they would need to derive from DataBoundControl because there were no interfaces that controls could implement to indicate that supported basic data binding operations. Some control vendors want to be able to derive their controls from Control to make them as lightweight as possible and to have the best performance.&lt;/p&gt;  &lt;p&gt;To solve this in .NET 4.0 we are adding new interfaces that controls can implement that indicate that they do databinding and also indicate whether the control displays a single item or a list of items. Here is a breakdown of the new interfaces:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="0" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;public interface IDataBoundControl &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Interface for accessing the common properties for data bound controls.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;string DataSourceID { get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets or sets the ID of the control from which the data-bound control retrieves its list of data items.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;IDataSource DataSourceObject { get; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets the actual data source control when DataSourceId is set.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;object DataSource { get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets or sets the object from which the data-bound control retrieves its list of data items.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;string[] DataKeyNames {get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets or sets an array that contains the names of the primary key fields for the items displayed in a control.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;DataBoundControlMode Mode { get; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets whether the control is in ReadOnly, Edit or Insert mode.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;string DataMember { get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets or sets the name of the list of data that the data-bound control binds to, in cases where the data source contains more than one distinct list of data items.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="0" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;public interface IDataBoundListControl&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Interface for data bound controls that display multiple rows and can selection.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;DataKeyArray DataKeys { get; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets a collection of DataKey objects that represent the data key value of each row in a GridView control.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;DataKey SelectedDataKey { get; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets the DataKey object that contains the data key value for the selected row in a GridView control.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;int SelectedIndex { get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets or sets the index of the selected row in a GridView control.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;string[] RowClientIDSuffix { get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;bool EnablePersistedSelection { get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets or sets whether the selection is based on index or on data keys.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="0" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;IDataBoundItemControl&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Interface for data bound controls that display a single item.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;DataKey DataKey { get; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets a DataKey object that represent the data key value of the row in a control.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="0" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;IFieldControl&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Interface for data bound controls that can automatically generate their fields based on data.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;         &lt;p&gt;IAutoFieldGenerator FieldsGenerator { get; set; }&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="384"&gt;         &lt;p&gt;Gets and sets the IAutoFieldGenerator which generates the fields.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;IDataBoundControl is implemented by a control to indicate that it support data binding. This includes datasources, primary keys and the mode the control operates in. IDataBoundListControl indicates a control that displays data in a list and supports selection. IDataBoundItemControl indicates a control that displays a single record at a time. And IFieldControl is for controls like GridView or DetailView that have the ability to autogenerate their columns. These new interfaces are implemented across all the standard data controls in 4.0 including ListView, GridView, DetailsView and FormView. If third party controls support these interfaces they will be usable with Dynamic Data.&lt;/p&gt;  &lt;p&gt;One of the control vendors &lt;a href="http://www.devexpress.com/" target="_blank"&gt;DevExpress&lt;/a&gt; has recently implemented Dynamic Data support without these interfaces in their grid control. Here is a very cool screencast by &lt;a href="http://twitter.com/MehulHarry" target="_blank"&gt;Mehul Harry&lt;/a&gt; that demonstrates their grid and Dynamic Data in action. With these new interfaces they will be able to support their spreadsheet control as well once 4.0 ships. View the screencast here: &lt;a title="http://community.devexpress.com/blogs/aspnet/archive/2009/02/01/asp-net-dynamic-data-and-devexpress-grid.aspx" href="http://community.devexpress.com/blogs/aspnet/archive/2009/02/01/asp-net-dynamic-data-and-devexpress-grid.aspx"&gt;http://community.devexpress.com/blogs/aspnet/archive/2009/02/01/asp-net-dynamic-data-and-devexpress-grid.aspx&lt;/a&gt;. Please check it out and let Mehul know what you think!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9468830" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Dynamic+Data/">Dynamic Data</category></item><item><title>Update for .NET 3.5 SP1 Released</title><link>http://blogs.msdn.com/b/scothu/archive/2008/12/30/update-for-net-3-5-sp1-released.aspx</link><pubDate>Tue, 30 Dec 2008 22:24:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9257513</guid><dc:creator>Scott H</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9257513</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/12/30/update-for-net-3-5-sp1-released.aspx#comments</comments><description>&lt;p&gt;There was an update to the .NET 3.5 SP1 release a couple of days ago and I have not seen a lot of mention to it so thought I would write a blog post and talk about how this update affects ASP.NET.&lt;/p&gt;  &lt;p&gt;First off you can search for &lt;a href="http://support.microsoft.com/kb/959209"&gt;KB959209&lt;/a&gt; in the Microsoft knowledge base for details on this update. Here is the direct URL to the article: &lt;a title="http://support.microsoft.com/kb/959209" href="http://support.microsoft.com/kb/959209"&gt;http://support.microsoft.com/kb/959209&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This update corrects the following issues that may affect an ASP.NET developer that has .NET 3.5 SP1 installed: &lt;/p&gt;  &lt;p&gt;- Dynamic Data used with Entity Framework generates an error when navigating one to one relationships&lt;/p&gt;  &lt;p&gt;- BrowserCaps generates an error if Front Page Server extensions are installed.&lt;/p&gt;  &lt;p&gt;- Using a derived UpdateProgress control may encounter an exception.&lt;/p&gt;  &lt;p&gt;- An exception is thrown if the website is using WPF to generate images and the site is hosted under IIS.&lt;/p&gt;  &lt;p&gt;There are other issues that are fixed in the framework and CLR that could affect applications so I suggest reading the list of changes in the knowledge base. &lt;/p&gt;  &lt;p&gt;If you are using Dynamic Data and Entity Framework then I highly recommend this update.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9257513" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Dynamic+Data/">Dynamic Data</category></item><item><title>Posting from Oredev in Sweden</title><link>http://blogs.msdn.com/b/scothu/archive/2008/11/21/posting-from-oredev-in-sweden.aspx</link><pubDate>Fri, 21 Nov 2008 17:56:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9131909</guid><dc:creator>Scott H</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9131909</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/11/21/posting-from-oredev-in-sweden.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://weblogs.asp.net/leftslipper/default.aspx" target="_blank"&gt;Eilon Lipton&lt;/a&gt; and I have spent the week in Malmo, Sweden at the the &lt;a href="http://www.oredev.org" target="_blank"&gt;Oredev&lt;/a&gt; conference. Here is the schedule of our talks:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;November 19th – &lt;a href="http://www.oredev.org/topmenu/program/tracknet/eilonlipton.4.3efb083311ac562f9fe80009264.html" target="_blank"&gt;Get to Know the ASP.NET MVC Framework&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;November 20th – &lt;a href="http://www.oredev.org/topmenu/program/tracknet/scotthunter.4.3efb083311ac562f9fe800011103.html" target="_blank"&gt;ASP.NET 4.0 Roadmap&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;November 20th – &lt;a href="http://www.oredev.org/topmenu/program/tracknet/scotthunter.4.3efb083311ac562f9fe800011103.html" target="_blank"&gt;Advanced ASP.NET MVC&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;November 21st – &lt;a href="http://www.oredev.org/topmenu/program/tracknet/scotthunter.4.3efb083311ac562f9fe800011103.html" target="_blank"&gt;ASP.NET Dynamic Data&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lostintangent.com/about/" target="_blank"&gt;Jonathan Carter&lt;/a&gt; has posted a great series of blogs posts on Dynamic Data. Check them out here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lostintangent.com/2008/11/17/dynamic-data-come-for-the-scaffolding-stay-for-everything-else/" target="_blank"&gt;Dynamic Data: Come For The Scaffolding, Stay For Everything Else&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://lostintangent.com/2008/11/19/dynamic-data-kickin-it-old-school/" target="_blank"&gt;Dynamic Data: Kickin’ It Old School&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://lostintangent.com/2008/11/19/dynamic-data-models-metamodels-and-everything-in-between/" target="_blank"&gt;Dynamic Data: Models, MetaModels And Everything In Between&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://lostintangent.com/2008/11/21/dynamic-data-the-little-metamodel-that-could/" target="_blank"&gt;Dynamic Data: The Little MetaModel That Could&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9131909" width="1" height="1"&gt;</description></item><item><title>Securing Dynamic Data</title><link>http://blogs.msdn.com/b/scothu/archive/2008/11/05/securing-dynamic-data.aspx</link><pubDate>Thu, 06 Nov 2008 02:42:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9045437</guid><dc:creator>Scott H</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9045437</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/11/05/securing-dynamic-data.aspx#comments</comments><description>&lt;p&gt;One of the questions we often get is how do you secure Dynamic Data websites. Michael Miele one of the technical writers that writes the documentation for ASP.NET wrote a great sample that shows how to do this using Form Authentication and Roles that are provided in ASP.NET. We uploaded his sample to the &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473" target="_blank"&gt;Dynamic Data Samples Site&lt;/a&gt; last night and I thought I would share it out. Click &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473" target="_blank"&gt;HERE&lt;/a&gt; to go to the sample page and scroll down to the section “Secure Dynamic Data”. Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9045437" width="1" height="1"&gt;</description></item><item><title>PDC ASP.NET Content Available Now</title><link>http://blogs.msdn.com/b/scothu/archive/2008/11/03/pdc-asp-net-content-available-now.aspx</link><pubDate>Mon, 03 Nov 2008 21:37:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9034380</guid><dc:creator>Scott H</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=9034380</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/11/03/pdc-asp-net-content-available-now.aspx#comments</comments><description>&lt;p&gt;Just got back from PDC 2008 last week, we showed all kinds of cool new stuff. Here is a list of links for the videos of all the ASP.NET sessions:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;ASP.NET 4.0 Roadmap - &lt;a title="http://channel9.msdn.com/pdc2008/PC20/" href="http://channel9.msdn.com/pdc2008/PC20/"&gt;http://channel9.msdn.com/pdc2008/PC20/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;ASP.NET MVC: A New Framework for Building Web Applications - &lt;a title="http://channel9.msdn.com/pdc2008/PC21/" href="http://channel9.msdn.com/pdc2008/PC21/"&gt;http://channel9.msdn.com/pdc2008/PC21/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Microsoft Visual Studio: Web Development Futures - &lt;a title="http://channel9.msdn.com/pdc2008/TL48/" href="http://channel9.msdn.com/pdc2008/TL48/"&gt;http://channel9.msdn.com/pdc2008/TL48/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Web Application Packaging and Deployment - &lt;a title="http://channel9.msdn.com/pdc2008/ES15/" href="http://channel9.msdn.com/pdc2008/ES15/"&gt;http://channel9.msdn.com/pdc2008/ES15/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;ASP.NET Dynamic Data - &lt;a title="http://channel9.msdn.com/pdc2008/PC30/" href="http://channel9.msdn.com/pdc2008/PC30/"&gt;http://channel9.msdn.com/pdc2008/PC30/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;ASP.NET: Cache Extensibility - &lt;a title="http://channel9.msdn.com/pdc2008/PC41/" href="http://channel9.msdn.com/pdc2008/PC41/"&gt;http://channel9.msdn.com/pdc2008/PC41/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;We also released new preview bits of Dynamic Data for PDC. You can check out the new bits from here: &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=18803" target="_blank"&gt;Dynamic Data Preview 1&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I’m also excited that &lt;a href="http://blogs.msdn.com/davidebb" target="_blank"&gt;David Ebbo&lt;/a&gt; has blogged an early version of support for many to many relationships in Entity Framework for Dynamic Data. You can see grab the code and use it with today's Dynamic Data. You can view the post: &lt;a href="http://blogs.msdn.com/davidebb/archive/2008/10/25/a-many-to-many-field-template-for-dynamic-data.aspx" target="_blank"&gt;HERE&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9034380" width="1" height="1"&gt;</description></item><item><title>Image Generation is released to CodePlex</title><link>http://blogs.msdn.com/b/scothu/archive/2008/08/21/image-generation-is-released-to-codeplex.aspx</link><pubDate>Fri, 22 Aug 2008 00:32:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8886156</guid><dc:creator>Scott H</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8886156</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/08/21/image-generation-is-released-to-codeplex.aspx#comments</comments><description>&lt;p&gt;I'm really happy to announce that earlier this week we released a new feature called Image Generation to the &lt;a href="http://www.codeplex.com/aspnet"&gt;ASP.NET CodePlex site&lt;/a&gt;. You can get a link directly to the page supporting this feature by clicking on: &lt;a title="http://www.codeplex.com/aspnet/Wiki/View.aspx?title=WebForms&amp;amp;referringTitle=Home" href="http://www.codeplex.com/aspnet/Wiki/View.aspx?title=WebForms&amp;amp;referringTitle=Home"&gt;http://www.codeplex.com/aspnet/Wiki/View.aspx?title=WebForms&amp;amp;referringTitle=Home&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There was a feature that was in Beta 1 for Visual Studio 2005 (Whitbey) called DynamicImage that provided a control for generating images and an image service for serving them. This feature was sadly cut because some of the other parts of the framework it depended on were cut.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Image Generation is basically work to bring this type of feature back into the framework. Here are some of the highlights of what this new feature does:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;New GeneratedImage ASP.NET control. This control is a derivative of asp:Image control that supports being hooked up to an Image Handler and passing parameters to it. If you put this control on a page and go into design mode it will have chrome attached to it that when clicked will automatically generate an ImageHandler and wire the control to the URL of the ImageHandler. Parameters such as the primary id and timestamp can be databound to the control and will automatically be passed to the handler.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;ImageHandler which is an implementation of IHttpHandler that provides support for many image based things:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Transforms (resizing, watermarks, user defined transforms)&lt;/li&gt;    &lt;li&gt;Client-side caching&lt;/li&gt;    &lt;li&gt;Server side caching&lt;/li&gt;    &lt;li&gt;Access to parameters passed from the GeneratedImage control&lt;/li&gt;    &lt;li&gt;Provide simple mechanics for returning images&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you click to the site there are three samples of how to use GeneratedImage:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Simple Generated Image - this shows how you would create a simple bitmap and return it&lt;/li&gt;    &lt;li&gt;Databased Images - shows how you would use this feature to display images that are stored in a database&lt;/li&gt;    &lt;li&gt;Custom Image Transforms - shows how to write a custom image transform that adds a ASP.NET logo to an image&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We are considering adding this feature in the next version of .NET and would love feedback. Please download and try and it out and let us know what you think!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8886156" width="1" height="1"&gt;</description></item><item><title>Workaround for Dynamic Data Entity Framework Posted</title><link>http://blogs.msdn.com/b/scothu/archive/2008/08/16/workaround-for-dynamic-data-entity-framework-posted.aspx</link><pubDate>Sun, 17 Aug 2008 01:49:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8872692</guid><dc:creator>Scott H</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8872692</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/08/16/workaround-for-dynamic-data-entity-framework-posted.aspx#comments</comments><description>&lt;p&gt;Today we posted a beta update to solve a couple of problems with Dynamic Data and Entity Framework that are in the RTM version of .NET 3.5 SP1. The main issue is a slight mis-match in the names that Dynamic Data looks for in Entity Framework and the names that Entity Framework is actually exposing. When this problem occurs an error that looks like &amp;quot;A property with name 'XX.Id' does not exist in metadata for entity type 'XX.XX.XXXX'&amp;quot;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Luckily we made the data model providers which are classes that look at data model and tell Dynamic Data what the tables, columns, names, etc are a extensible system. This means we can distribute a replacement data model provider that solves the issue I mentioned above. You can download a replacement Entity Framework provider at this link: &lt;a title="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16367" href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16367"&gt;http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16367&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you are running into this issue please download the fix above and let us know if it solves your issues.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8872692" width="1" height="1"&gt;</description></item><item><title>Dynamic Data RTM is Released!</title><link>http://blogs.msdn.com/b/scothu/archive/2008/08/11/dynamic-data-rtm-is-released.aspx</link><pubDate>Mon, 11 Aug 2008 19:44:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8848425</guid><dc:creator>Scott H</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8848425</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/08/11/dynamic-data-rtm-is-released.aspx#comments</comments><description>&lt;p&gt;Today we shipped .NET 3.5 SP1 which includes Dynamic Data. This means that the Dynamic Data RTM release is now available. Here are the links to download the final versions:&lt;/p&gt; &lt;p&gt;Visual Studio 2008 SP1 (also includes .NET 3.5 SP1): &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt; &lt;p&gt;.NET 3.5 SP1 Standalone Installer: &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;amp;displaylang=en&lt;/a&gt; &lt;p&gt;&amp;nbsp; &lt;p&gt;You can also preview some of the upcoming changes and new features we are working on for Dynamic Data 2.0 and Dynamic Data MVC. You can view these on our page on the Codeplex site. You can view the ASP.NET page on Codeplex here: &lt;a title="http://www.codeplex.com/aspnet" href="http://www.codeplex.com/aspnet"&gt;http://www.codeplex.com/aspnet&lt;/a&gt;. Click the Dynamic Data link to see all of our preview releases.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8848425" width="1" height="1"&gt;</description></item><item><title>Many Updates on Dynamic Data</title><link>http://blogs.msdn.com/b/scothu/archive/2008/07/21/many-updates-on-dynamic-data.aspx</link><pubDate>Mon, 21 Jul 2008 19:26:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8761936</guid><dc:creator>Scott H</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8761936</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/07/21/many-updates-on-dynamic-data.aspx#comments</comments><description>&lt;p&gt;This week at Redmond we have the ASP.NET Insiders up here where we show them a bunch of the new stuff we are working on. I'm happy to announce that we have many new update for Dynamic Data that are available today:&lt;/p&gt;  &lt;p&gt;1) &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14474" target="_blank"&gt;Dynamic Data Runtime and Dynamic Data Wizard&lt;/a&gt; - this has been updated with a much newer version of the Dynamic Data Wizard which have over 30 bug fixes. This is a wizard that provides many options for which tables to show, which modes to show them (read only/read write, etc) and allows multiple tables in the same page. All of the generated code uses features from the new Dynamic Data feature.&lt;/p&gt;  &lt;p&gt;2) &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14475" target="_blank"&gt;Dynamic Data Futures&lt;/a&gt; - this is a sample project that shows off many of the cool directions we are looking at for the next version of Dynamic Data. An example of some of these features are: ADO.NET Data Services (formerly known as Astoria), ObjectDataSource, binding and validation for plain old CLR objects (POCO), metadata for ordering columns,&amp;#160; adding metadata at runtime, support for images, advanced filtering including cascading and much more.&lt;/p&gt;  &lt;p&gt;3) &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=15459" target="_blank"&gt;Dynamic Data for MVC Preview&lt;/a&gt; - we are working to support Dynamic Data on the new ASP.NET MVC framework as well. This is an EARLY release of this support. Compared to the WebForm version this has the current limitations: Only supports Linq to SQL, does not have client side validation and does not have filters on the list pages. Futures releases will address each of these items plus provide much more.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8761936" width="1" height="1"&gt;</description></item><item><title>Interview with Craig Shoemaker Posted</title><link>http://blogs.msdn.com/b/scothu/archive/2008/07/01/interview-with-craig-shoemaker-posted.aspx</link><pubDate>Tue, 01 Jul 2008 20:30:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8677922</guid><dc:creator>Scott H</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8677922</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/07/01/interview-with-craig-shoemaker-posted.aspx#comments</comments><description>&lt;p&gt;Last week I had a great chat with Craig Shoemaker on Dynamic Data. We talked about using Dynamic Data in existing applications, some about our new &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14475" target="_blank"&gt;Futures release&lt;/a&gt; and some about upcoming work on having an MVC version of Dynamic Data. You can check out the interview on Pixel8 by clicking here: &lt;a href="http://pixel8.infragistics.com/shows/dyndata.aspx#Episode:9399" target="_blank"&gt;Craig Shoemaker interview&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8677922" width="1" height="1"&gt;</description></item><item><title>How to add Dynamic Data to an Existing Web Application</title><link>http://blogs.msdn.com/b/scothu/archive/2008/06/24/how-to-add-dynamic-data-to-an-existing-web-application.aspx</link><pubDate>Tue, 24 Jun 2008 11:18:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8646287</guid><dc:creator>Scott H</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8646287</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/06/24/how-to-add-dynamic-data-to-an-existing-web-application.aspx#comments</comments><description>&lt;p&gt;Yesterday I &lt;a href="http://blogs.msdn.com/scothu/archive/2008/06/23/how-to-add-dynamic-data-to-an-existing-web-site.aspx"&gt;posted&lt;/a&gt; about how to add Dynamic Data to an existing website and I got some feedback about how to add Dynamic Data to an existing web application. Web application projects work a little different the website projects, you can check out the differences here: &lt;a title="http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx" href="http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;1) Create a dummy Dynamic Data web application project. Copy the DynamicData directory from it into your existing web application. You should also copy the Site.css and Site.master files. The Default.aspx file is optional, it display a menu of tables in your data model, this file is only needed if you plan on having such a menu in your application. &lt;strong&gt;IMPORTANT: Web application projects have namespaces in their code behind files, you may want to change the namespaces of the copied in files to match the namespace of your existing project.&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;2) You can copy the Global.asax file or if you already have such a file you can just add the model registration and url routes as below to the &lt;/p&gt;  &lt;p&gt;&amp;lt;%@ Import Namespace=&amp;quot;System.Web.Routing&amp;quot; %&amp;gt;    &lt;br /&gt;&amp;lt;%@ Import Namespace=&amp;quot;System.Web.DynamicData&amp;quot; %&amp;gt;&lt;/p&gt;  &lt;p&gt;void Application_Start(object sender, EventArgs e) {&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;MetaModel model = new MetaModel(); &lt;/p&gt;    &lt;p&gt;model.RegisterContext(typeof(YourDataContextType), new ContextConfiguration() { ScaffoldAllTables = false }); &lt;/p&gt;    &lt;p&gt;routes.Add(new DynamicDataRoute(&amp;quot;{table}/{action}.aspx&amp;quot;) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Constraints = new RouteValueDictionary(new { action = &amp;quot;List|Details|Edit|Insert&amp;quot; }),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Model = model       &lt;br /&gt;});&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;3) Right click on the References node in the solution explorer and select &amp;quot;Add Reference&amp;quot;. In the dialog that opens up you need to select System.ComponentModel.DataAnnotations, System.Web.Abstractions, System.Web.DynamicData and System.Web.Routing.&lt;/p&gt;  &lt;p&gt;4) In the &amp;lt;compilation&amp;gt; section in web.config add the following assemblies:&lt;/p&gt;  &lt;p&gt;&amp;lt;add assembly=&amp;quot;System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;lt;add assembly=&amp;quot;System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;     &lt;br /&gt;&amp;lt;add assembly=&amp;quot;System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;     &lt;br /&gt;&amp;lt;add assembly=&amp;quot;System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt; &lt;/p&gt;  &lt;p&gt;5) In the &amp;lt;pages&amp;gt;/&amp;lt;controls&amp;gt; section add the following new tag prefix:&lt;/p&gt;  &lt;p&gt;&amp;lt;add tagPrefix=&amp;quot;asp&amp;quot; namespace=&amp;quot;System.Web.DynamicData&amp;quot; assembly=&amp;quot;System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt; &lt;/p&gt;  &lt;p&gt;6) Enable the new ASP.NET Routing feature:&lt;/p&gt;  &lt;p&gt;IIS 5/6/Casini&lt;/p&gt;  &lt;p&gt;In the &amp;lt;httpModules&amp;gt; section add the following new module:&lt;/p&gt;  &lt;p&gt;&amp;lt;add name=&amp;quot;UrlRoutingModule&amp;quot; type=&amp;quot;System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;IIS 7&lt;/p&gt;  &lt;p&gt;In the &amp;lt;system.webServer&amp;gt;/&amp;lt;modules&amp;gt; section add the following:&lt;/p&gt;  &lt;p&gt;&amp;lt;remove name=&amp;quot;UrlRoutingModule&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;lt;add name=&amp;quot;UrlRoutingModule&amp;quot; type=&amp;quot;System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;In the &amp;lt;system.webServer&amp;gt;/&amp;lt;handlers&amp;gt; section add the following:&lt;/p&gt;  &lt;p&gt;&amp;lt;add name=&amp;quot;UrlRoutingHandler&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;UrlRouting.axd&amp;quot; type=&amp;quot;System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;At this point Dynamic Data should be functional. To enable it see the steps at the bottom of &lt;a href="http://blogs.msdn.com/scothu/archive/2008/06/23/how-to-add-dynamic-data-to-an-existing-web-site.aspx"&gt;yesterdays post&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8646287" width="1" height="1"&gt;</description></item><item><title>How to add Dynamic Data to an Existing Web Site</title><link>http://blogs.msdn.com/b/scothu/archive/2008/06/23/how-to-add-dynamic-data-to-an-existing-web-site.aspx</link><pubDate>Mon, 23 Jun 2008 11:07:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8641644</guid><dc:creator>Scott H</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8641644</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/06/23/how-to-add-dynamic-data-to-an-existing-web-site.aspx#comments</comments><description>&lt;p&gt;I've had various people ask me if Dynamic Data can be added to an existing website and I've compiled a list of steps to do this. We hope to add a tooling gesture to Visual Studio in the future to automatically do these steps. Once these steps are complete you can start taking advantage of Dynamic Data functionality in your existing applications.&lt;/p&gt;  &lt;p&gt;1) Create a dummy Dynamic Data Website project. Copy the DynamicData directory from it into your existing website. You should also copy the Site.css and Site.master files. The Default.aspx file is optional, it display a menu of tables in your data model, this file is only needed if you plan on having such a menu in your application.&lt;/p&gt;  &lt;p&gt;2) You can copy the Global.asax file or if you already have such a file you can just add the model registration and url routes as below to the &lt;/p&gt;  &lt;p&gt;&amp;lt;%@ Import Namespace=&amp;quot;System.Web.Routing&amp;quot; %&amp;gt;   &lt;br /&gt;&amp;lt;%@ Import Namespace=&amp;quot;System.Web.DynamicData&amp;quot; %&amp;gt;&lt;/p&gt;  &lt;p&gt;void Application_Start(object sender, EventArgs e) {&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;MetaModel model = new MetaModel(); &lt;/p&gt;    &lt;p&gt;model.RegisterContext(typeof(YourDataContextType), new ContextConfiguration() { ScaffoldAllTables = false }); &lt;/p&gt;    &lt;p&gt;routes.Add(new DynamicDataRoute(&amp;quot;{table}/{action}.aspx&amp;quot;) {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Constraints = new RouteValueDictionary(new { action = &amp;quot;List|Details|Edit|Insert&amp;quot; }),      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Model = model      &lt;br /&gt;});&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;3) In the &amp;lt;compilation&amp;gt; section in web.config add the following assemblies:&lt;/p&gt;  &lt;p&gt;&amp;lt;add assembly=&amp;quot;System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;   &lt;br /&gt;&amp;lt;add assembly=&amp;quot;System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;lt;add assembly=&amp;quot;System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;lt;add assembly=&amp;quot;System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;4) In the &amp;lt;pages&amp;gt;/&amp;lt;controls&amp;gt; section add the following new tag prefix:&lt;/p&gt;  &lt;p&gt;&amp;lt;add tagPrefix=&amp;quot;asp&amp;quot; namespace=&amp;quot;System.Web.DynamicData&amp;quot; assembly=&amp;quot;System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;/&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;5) Enable the new ASP.NET Routing feature:&lt;/p&gt;  &lt;p&gt;IIS 5/6/Casini&lt;/p&gt;  &lt;p&gt;In the &amp;lt;httpModules&amp;gt; section add the following new module:&lt;/p&gt;  &lt;p&gt;&amp;lt;add name=&amp;quot;UrlRoutingModule&amp;quot; type=&amp;quot;System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;IIS 7&lt;/p&gt;  &lt;p&gt;In the &amp;lt;system.webServer&amp;gt;/&amp;lt;modules&amp;gt; section add the following:&lt;/p&gt;  &lt;p&gt;&amp;lt;remove name=&amp;quot;UrlRoutingModule&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;lt;add name=&amp;quot;UrlRoutingModule&amp;quot; type=&amp;quot;System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;In the &amp;lt;system.webServer&amp;gt;/&amp;lt;handlers&amp;gt; section add the following:&lt;/p&gt;  &lt;p&gt;&amp;lt;add name=&amp;quot;UrlRoutingHandler&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;UrlRouting.axd&amp;quot; type=&amp;quot;System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;At this point you need to register your Linq to SQL data modelin step #2 and optionally enable scaffolding by setting ScaffoldAllTables := true in the registratoin line. At this point if you copied the Default.aspx from the dummy Dynamic Data application you can execute it to view the scaffold. You can also enable Dynamic Data in existing web pages that use GridView, ListView, FormView and DetailsView by adding a DynamicDataManager to those pages and then registering the data control with the dynamic data manger:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;lt;asp:DynamicDataManager id=&amp;quot;DynamicDataManager1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;asp:GridView id=&amp;quot;GridView1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;  &lt;p&gt;...&lt;/p&gt;  &lt;p&gt;DynamicDataManager1.Register(GridView1);&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Inside of your GridView or DetailsView you can either use AutoGenerateColumns or you can use DynamicField controls in your column collections. If you are using ListView or FormView use DynamicControl to display values for each of your columns.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8641644" width="1" height="1"&gt;</description></item><item><title>Dynamic Data DbImage SampleUpdated</title><link>http://blogs.msdn.com/b/scothu/archive/2008/06/17/dynamic-data-dbimage-sampleupdated.aspx</link><pubDate>Tue, 17 Jun 2008 12:07:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8610208</guid><dc:creator>Scott H</dc:creator><slash:comments>20</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8610208</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/06/17/dynamic-data-dbimage-sampleupdated.aspx#comments</comments><description>&lt;p&gt;I posted a sample back in January on how to display images from databases or the file system using Dynamic Data. You can view that post &lt;a href="http://blogs.msdn.com/scothu/archive/2008/01/14/sample.aspx"&gt;HERE&lt;/a&gt;. I've just updated that sample to fix some bugs and add some new functionality. You can download the latest version of DbImage from this link: &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=dynamicdata&amp;amp;DownloadId=1922"&gt;DOWNLOAD DBIMAGE&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Here is a list of the changes and updates I've made since the original post:&lt;/p&gt;  &lt;p&gt;1) Fixed an issue that caused DbImage not to work when the primary column for the table is a GUID.&lt;/p&gt;  &lt;p&gt;2) Added support for compound primary keys (primary key that is more then one column in the table).&lt;/p&gt;  &lt;p&gt;3) Added support for Entity Framework (previous release would display images in Entity Framework but fail to update them).&lt;/p&gt;  &lt;p&gt;4) The asp:FileUpload control does not work correctly inside of UpdatePanels with partial rendering turned on. By default the templates in Dynamic Data are enclosed in UpdatePanels with partial rendering turned on. This means that uploading of images will fail unless partial rendering is disabled. The new sample adds a helper method call in the Page_Init of the Insert, Edit and ListDetails page templates. This helper call looks to see if any of the displayed columns are DbImage columns and if so turns off partial rendering for the page.&lt;/p&gt;  &lt;p&gt;DbImageAPI.ImageHelper.DisablePartialRenderingForUpload(this, DetailsDataSource.GetTable()); &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8610208" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Dynamic+Data/">Dynamic Data</category></item><item><title>Dynamic Data is on .NET Rocks!</title><link>http://blogs.msdn.com/b/scothu/archive/2008/06/10/dynamic-data-is-on-net-rocks.aspx</link><pubDate>Tue, 10 Jun 2008 23:54:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590410</guid><dc:creator>Scott H</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/scothu/rsscomments.aspx?WeblogPostID=8590410</wfw:commentRss><comments>http://blogs.msdn.com/b/scothu/archive/2008/06/10/dynamic-data-is-on-net-rocks.aspx#comments</comments><description>&lt;p&gt;A few weeks ago I did an interview with Carl and Richard from .NET rocks on Dynamic Data. You can listen to it here: &lt;a title="http://www.dotnetrocks.com/default.aspx?showNum=349" href="http://www.dotnetrocks.com/default.aspx?showNum=349"&gt;http://www.dotnetrocks.com/default.aspx?showNum=349&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8590410" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/scothu/archive/tags/ASP-NET/">ASP.NET</category><category domain="http://blogs.msdn.com/b/scothu/archive/tags/Dynamic+Data/">Dynamic Data</category></item></channel></rss>