<?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 : ASP.NET</title><link>http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Dynamic Data Preview 4 Released</title><link>http://blogs.msdn.com/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>scothu</dc:creator><slash:comments>16</slash:comments><comments>http://blogs.msdn.com/scothu/comments/9593141.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=9593141</wfw:commentRss><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/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">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/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>scothu</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/scothu/comments/9501609.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=9501609</wfw:commentRss><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/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">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/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>scothu</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/scothu/comments/9468830.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=9468830</wfw:commentRss><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/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Update for .NET 3.5 SP1 Released</title><link>http://blogs.msdn.com/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>scothu</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/scothu/comments/9257513.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=9257513</wfw:commentRss><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/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Dynamic Data DbImage SampleUpdated</title><link>http://blogs.msdn.com/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>scothu</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8610208.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8610208</wfw:commentRss><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/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Dynamic Data is on .NET Rocks!</title><link>http://blogs.msdn.com/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>scothu</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8590410.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8590410</wfw:commentRss><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/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>New Refresh of Dynamic Data Runtime and Tools is Posted</title><link>http://blogs.msdn.com/scothu/archive/2008/04/23/new-refresh-of-dynamic-data-runtime-and-tools-is-posted.aspx</link><pubDate>Thu, 24 Apr 2008 06:47:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8420642</guid><dc:creator>scothu</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8420642.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8420642</wfw:commentRss><description>&lt;p&gt;Tonight we posted a new release of the Dynamic Data Runtime and Tool on the Code Gallery website. You can grab the new release by clicking here: &lt;a title="http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=954" href="http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=954"&gt;http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=954&lt;/a&gt;. We have also updated the samples to work with the latest runtime, they are available here: &lt;a title="http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=850" href="http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=850"&gt;http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=850&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There are many changes and fixes in this new update. Here are the highlights:&lt;/p&gt;  &lt;p&gt;&lt;a name="_Toc196709127"&gt;Installation&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The previous release could experience problems during installation on 64-bit computers and on computers that do not have the full .NET Framework SDK installed. The current release includes the required tools for installation, so it works on computers that have just the .NET Framework 3.5 installed. Installation on 64-bit computers should work properly now.&lt;/p&gt;  &lt;h5&gt;&lt;a name="_Toc196709128"&gt;Upgrading&lt;/a&gt;&lt;/h5&gt;  &lt;p&gt;Various changes have been made to the field templates and .css files that are in the &amp;#8220;DynamicData&amp;#8221; folder. The best upgrade path (if practical) is to copy the new &amp;#8220;DynamicData&amp;#8221; folder into an existing project; the new folder contains all the latest field templates.&lt;/p&gt;  &lt;h5&gt;&lt;a name="_Toc196709129"&gt;Documentation&lt;/a&gt;&lt;/h5&gt;  &lt;p&gt;The previous release was released with no documentation except the Readme file. This release contains a &amp;quot;Preliminary ASP.NET Documentation.chm&amp;quot; Windows Help file file that contains some documentation for ASP.NET Dynamic Data. This is ASP.NET 3.5 pre-release documentation and is not supported by Microsoft. Blank topics are included as placeholders and existing content is subject to change in future releases.&lt;/p&gt;  &lt;h5&gt;&lt;a name="_Toc196709130"&gt;Dynamic Data Runtime&lt;/a&gt;&lt;/h5&gt;  &lt;p&gt;Dynamic Data now defaults to using separate pages for listing and editing data instead of using the combined List/Details style that was used in the earlier release. You can re-enable the previous method by changing the routes in the Global.asax file.&lt;/p&gt;  &lt;p&gt;All metadata attributes now perform validation in the Web page. In the previous release, a metadata validation attribute caused validation to be performed only if the field template contained an ASP.NET server validation control that mapped to the attribute.&lt;/p&gt;  &lt;p&gt;Dynamic Data now can use routing not only for the path, but for the query string as well. For example, instead of having the primary key passed as an explicit query string value (Products/Details.aspx?productid=1) , the key can instead be part of the URL (Products/Details/1). This change enables you to create cleaner routes, as shown in the following example:&lt;/p&gt;  &lt;p&gt;RouteTable.Routes.Add(new DynamicDataRoute(&amp;quot;MyCategoryDetail/{CategoryID}&amp;quot;) {&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Model = model,&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Table = &amp;quot;Categories&amp;quot;,&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Action = &amp;quot;Details&amp;quot;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;});&lt;/p&gt;  &lt;p&gt;RouteTable.Routes.Add(new DynamicDataRoute(&amp;quot;{CategoryID}/MyProductList&amp;quot;) {&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Model = model,&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Table = &amp;quot;Products&amp;quot;,&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Action = &amp;quot;List&amp;quot;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;});&lt;/p&gt;  &lt;p&gt;In the first route definition, the primary key is passed as part of the path (for example, /app/MyCategoryDetail/5). In the second example, the foreign key is being passed as part of the URL (for example, /app/5/MyProductList). The foreign key does not have to be reversed, obviously; this example just shows what you can do with routing in Dynamic Data.&lt;/p&gt;  &lt;p&gt;The DataTypeAttribute attribute has new values, such as EmailAddress and Html. When DataTypeAttribute is applied to columns with types of Date, Time, and Currency, Dynamic Data now applies default formatting of {0:d}, {0:t}, and {0:C} automatically, which provides a nicer display in display and edit modes. You can override this behavior by placing a DisplayFormatAttribute attribute on the column.&lt;/p&gt;  &lt;p&gt;The fallback behavior of Dynamic Data for types that are not recognized has been changed. Instead of displaying an exception, a blank value is returned. This occurs when columns are displayed that Dynamic Data does not have a field template for.&lt;/p&gt;  &lt;p&gt;The TextArea_Edit.ascx field template has been renamed to MultilineText_Edit.ascx. This change was made so that he template maps to the MultilineText data type that DataTypeAttribute supports. In addition, the &amp;lt;textarea&amp;gt; element that is rendered by the control has been made larger.&lt;/p&gt;  &lt;h5&gt;&lt;a name="_Toc196709131"&gt;Tools and Dynamic Data Website Wizard&lt;/a&gt;&lt;/h5&gt;  &lt;p&gt;The Dynamic Data Website Wizard (Preview) template is now supported for Visual Basic.&lt;/p&gt;  &lt;p&gt;The pages generated by the wizard have undergone the following changes:&lt;/p&gt;  &lt;p&gt;&amp;#183; Pages use the included Site.master page by default. (Eventually the wizard will let you choose a custom master page or choose to use no master page.)&lt;/p&gt;  &lt;p&gt;&amp;#183; ValidationSummary and DynamicValidator controls are generated, which enables automatic handling of validation exceptions.&lt;/p&gt;  &lt;p&gt;&amp;#183; Improvements and changes have been made to the styles that are applied to the wizard-generated pages. These changes are defined in Site.css.&lt;/p&gt;  &lt;p&gt;&amp;#183; An improved ListViewPager user control for paging in the ListView control has been added to the template.&lt;/p&gt;  &lt;p&gt;&amp;#183; Several code generation improvements have been made. These includes rendering drop-down lists for foreign-key fields in edit and insert modes, confirmation dialog boxes for Delete links, addition of an EmptyDataTemplate template in the ListView control, and fixing the Show All Items (formerly Go Back) links for Details forms.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8420642" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Podcast with Scott Hanselman on Dynamic Data</title><link>http://blogs.msdn.com/scothu/archive/2008/04/22/podcast-with-scott-hanselman-on-dynamic-data.aspx</link><pubDate>Wed, 23 Apr 2008 08:32:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8418182</guid><dc:creator>scothu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8418182.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8418182</wfw:commentRss><description>&lt;p&gt;I was able to sit down with Scott Hanselman last week after giving a Dynamic Data talk to the Microsoft MVP's and record a podcast about Dynamic Data. Here is a link to the podcast, enjoy: &lt;a href="http://www.hanselminutes.com/default.aspx?showID=127"&gt;http://www.hanselminutes.com/default.aspx?showID=127&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8418182" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Telerik has released some sample field template controls for Dynamic Data</title><link>http://blogs.msdn.com/scothu/archive/2008/04/16/telerik-has-released-some-sample-field-template-controls-for-dynamic-data.aspx</link><pubDate>Wed, 16 Apr 2008 20:43:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8399263</guid><dc:creator>scothu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8399263.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8399263</wfw:commentRss><description>&lt;p&gt;One of the very cool extensibility points of Dynamic Data is our field template mechanism. In the existing data controls like GridView and DetailsView when the controls render a column they use some build in classes like BoundField, CheckBoxField, etc to display the column. These are not very extensible and once you decide you want to take over the rendering you need to turn the column into a templated column and manually manage the column yourself. With Dynamic Data what we have done is created a new concept called a Field Template which has a naming convention based on the data type. We provide the source code to these and they live in a directory &amp;quot;DynamicData\FieldTemplates&amp;quot;. What this means is if you want to change the way a boolean column is rendered or edited you can go into that directory and modify Boolean.ascx and Boolean_Edit.ascx yourself. Whatever changes you make here will affect the way that booleans are shown and editing across your entire site. You can also add new FieldTemplates with custom names and in that case to make the control use them you can either mark you data model with a UIHint:&lt;/p&gt;  &lt;p&gt;[MetadataType(typeof(ProductMetadata))]&lt;/p&gt;  &lt;p&gt;public partial Product {&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;public class ProductMetadata {&lt;/p&gt;  &lt;p&gt;&amp;#160; [UIHint(&amp;quot;IntegerSlider&amp;quot;)]&lt;/p&gt;  &lt;p&gt;&amp;#160; public object UnitsOnOrder { get; set; }&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;or do it on page by page basis:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;lt;Columns&amp;gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;DynamicField DataField=&amp;quot;UnitsOnOrder&amp;quot; UIHint=&amp;quot;IntegerSlider&amp;quot;&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;lt;/Columns&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This should be really exciting for custom control vendors because they can now create FieldTemplate controls which can be dropped in the directory making our controls automatically use their fancier controls right out of the box. Telerik has released some early samples of some of their controls wrapped in FieldTemplates today which you can look at by jumping to this blog post: &lt;a title="http://blogs.telerik.com/AtanasKorchev/Posts/08-04-16/RadControls_and_ASP_NET_Dynamic_Data_-_Part_Deux.aspx?ReturnURL=%2fblogs.aspx" href="http://blogs.telerik.com/AtanasKorchev/Posts/08-04-16/RadControls_and_ASP_NET_Dynamic_Data_-_Part_Deux.aspx?ReturnURL=%2fblogs.aspx"&gt;http://blogs.telerik.com/AtanasKorchev/Posts/08-04-16/RadControls_and_ASP_NET_Dynamic_Data_-_Part_Deux.aspx?ReturnURL=%2fblogs.aspx&lt;/a&gt;. We have other control vendors doing the same thing and I will blog about them when they are released.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8399263" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>New Public Preview of Dynamic Data is Now Available</title><link>http://blogs.msdn.com/scothu/archive/2008/04/09/new-public-preview-of-dynamic-data-is-now-available.aspx</link><pubDate>Thu, 10 Apr 2008 08:15:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8374089</guid><dc:creator>scothu</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8374089.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8374089</wfw:commentRss><description>&lt;p&gt;Today we released a new public release of Dynamic Data on the MSDN code gallery site. You can download the new version at: &lt;a title="http://code.msdn.microsoft.com/dynamicdata" href="http://code.msdn.microsoft.com/dynamicdata"&gt;http://code.msdn.microsoft.com/dynamicdata&lt;/a&gt;. These releases are cutting edge releases and not as refined as a CTP but this is a great way for us to get much newer code than the December CTP into peoples hands. We need as much feedback as we can get on this new version so we can lock down Dynamic Data for RTM.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Also as part of this new public release is the new &amp;quot;Dynamic Data Website Wizard&amp;quot;. This is a new wizard for building a Dynamic Data drive site from a wizard type experience. You can select a database, decide which items from the database need to be in the data model then customize the site on a page by page basis determine which operations the pages support including layout types. Then the tool generates the actual website using the features of Dynamic Data controls. You can read much more and see a screencast at: &lt;a title="http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Wizard&amp;amp;referringTitle=Home" href="http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Wizard&amp;amp;referringTitle=Home"&gt;http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Wizard&amp;amp;referringTitle=Home&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;We have also released some samples including an image library for Dynamic Data. You can see these samples at: &lt;a title="http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Samples%20Page&amp;amp;referringTitle=Home" href="http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Samples%20Page&amp;amp;referringTitle=Home"&gt;http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=Samples%20Page&amp;amp;referringTitle=Home&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Please try out these new bits and give us feedback on the ASP.NET forums at: &lt;a title="http://forums.asp.net/1145.aspx" href="http://forums.asp.net/1145.aspx"&gt;http://forums.asp.net/1145.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8374089" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Sample for Displaying Images Updated + Screencast</title><link>http://blogs.msdn.com/scothu/archive/2008/04/09/sample-for-displaying-images-updated-screencast.aspx</link><pubDate>Wed, 09 Apr 2008 22:39:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8373141</guid><dc:creator>scothu</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8373141.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8373141</wfw:commentRss><description>&lt;p&gt;We've recently started getting newer builds of Dynamic Data out to the private testers and soon to more public testers. As a result I've got an updated version of my image controls that I posted on my blog in January. As well I've recorded a screen cast that shows how to use the image controls in a project. Here is the link to the new DbImage project for display images from the database or file system in a Dynamic Data project: &lt;a href="http://www.cshonline.com/dbimage20.zip"&gt;DOWNLOAD DBIMAGE&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is a link to a screencast on how to use the controls: &lt;a href="http://davidebbo.members.winisp.net/screencasts/dbimage.wmv"&gt;VIEW SCREENCAST&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Basic steps for using this in a project:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;1) Open the zip file and open the redist directory. Copy the DLL from the Bin directory to the Bin directory in your website.&lt;/p&gt;  &lt;p&gt;2) In the Redist\FieldTemplates directory copy the files from that directory to the DynamicData\FieldTemplates directory in your website.&lt;/p&gt;  &lt;p&gt;3) Open the web.config and add &amp;quot;&amp;lt;add path=&amp;quot;ImageHandler.ashx&amp;quot; verb=&amp;quot;*&amp;quot; type=&amp;quot;DbImageAPI.ImageHandler&amp;quot; /&amp;gt;&amp;quot; to the httpHandlers section of your web.config.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;At this point you have enabled image support in your project. To get it to work you need to add a UIHint attribute to the column in your data model that contains the image. Here are the steps for doing this for the Category table in Northwind.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;1) Create a partial class for the Category table to extend the Category table in the data model. Right click on the project and click &amp;quot;Add New Item&amp;quot;. Select &amp;quot;Class&amp;quot;. Type in &amp;quot;Category&amp;quot;. Press Add.&lt;/p&gt;  &lt;p&gt;2) Add &amp;quot;using System.ComponentModel.DataAnnotations&amp;quot; and &amp;quot;using DbImageAPI&amp;quot; to the using clause section.&lt;/p&gt;  &lt;p&gt;3) Change the definition of the class to look like this:&lt;/p&gt;  &lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;MetadataType&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;CategoryMetadata&lt;/span&gt;))]
&lt;span style="color: blue"&gt;public partial class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Category
&lt;/span&gt;{
}

&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CategoryMetadata &lt;/span&gt;{
    [&lt;span style="color: #2b91af"&gt;UIHint&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;DbImage&amp;quot;&lt;/span&gt;)]
    &lt;span style="color: blue"&gt;public object &lt;/span&gt;Picture { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;What we have done is changed the Category class to be a partial class so it extends the class from the data model. Next we have created a class &amp;quot;CategoryMetadata&amp;quot; that is used to provide metadata for the Category class. The MetadataType attribute is what associates this class with the original Category class. Next we have created a Picture member which we can place metadata on (this is sort of a hack we do today because C# does not support adding attributes on existing members in partial classes, hopefully a future version of C# will address this). Then we apply the UIHint attribute which specifies which field template will be used to render this column.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;At this point running the application should display the images.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The sample download contains both the redist directory that contains all the stuff for adding this support to an existing project. Plus a fully running sample that builds the library. Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8373141" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Presenting At VSLive in San Francisco Next Week</title><link>http://blogs.msdn.com/scothu/archive/2008/03/27/presenting-at-vslive-in-san-francisco-next-week.aspx</link><pubDate>Thu, 27 Mar 2008 23:48:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8340375</guid><dc:creator>scothu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8340375.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8340375</wfw:commentRss><description>&lt;p&gt;I will be presenting Dynamic Data at VS Live in San Francisco next week on March 31, 2008. You can see full details of the show here: &lt;a title="http://vslive.com/2008/sf/" href="http://vslive.com/2008/sf/"&gt;http://vslive.com/2008/sf/&lt;/a&gt;. My presentation is at 3pm on Monday. If you are at the show please stop by and see Dynamic Data in action. Bradley Millington from the Web Tools team will be doing a presentation on Visual Studio 2008 and .NET 3.5 as well. Plus there are sessions on MVC and Silverlight. Hope to see you there!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8340375" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item><item><title>Cleaning up Default GridView Markup</title><link>http://blogs.msdn.com/scothu/archive/2008/03/26/cleaning-up-default-gridview-markup.aspx</link><pubDate>Thu, 27 Mar 2008 01:21:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8338453</guid><dc:creator>scothu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8338453.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8338453</wfw:commentRss><description>&lt;p&gt;I saw an interesting question today from a customer related to some of the default markup for a GridView. The following code:&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;GridView1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;     &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Will generate this markup in the web page:&lt;/p&gt;  &lt;p&gt;&amp;lt;table cellspacing=&amp;quot;0&amp;quot; rules=&amp;quot;all&amp;quot; border=&amp;quot;1&amp;quot; id=&amp;quot;GridView1&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;/table&amp;gt;&lt;/p&gt;  &lt;p&gt;Adding: &lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: red"&gt;CellSpacing&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;GridLines&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;None&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Will clean the markup considerably generating this in the web page:&lt;/p&gt;

&lt;p&gt;&amp;lt;table border=&amp;quot;0&amp;quot; id=&amp;quot;GridView1&amp;quot;&amp;gt;&lt;/p&gt;

&lt;p&gt;There currently is no way to get rid of the final Border=&amp;quot;0&amp;quot; but the above technique does clean up the table considerably.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8338453" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Accessing Controls in ListView Templates</title><link>http://blogs.msdn.com/scothu/archive/2008/03/26/accessing-controls-in-listview-templates.aspx</link><pubDate>Wed, 26 Mar 2008 11:09:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8337423</guid><dc:creator>scothu</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/scothu/comments/8337423.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=8337423</wfw:commentRss><description>&lt;p&gt;Today when doing some application building I came across a case where I wanted to embed a ASP control inside one of the template of the asp:ListView control. This is legal and simple todo, however it has some interesting effects. Since the control is embedded in a template it is not made available in the code behind file and in my case I wanted to be able to access the control in the code behind file. Here is an example of what my markup looked like:&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListView &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ListView1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&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;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaceHolder &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ItemPlaceHolder&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaceHolder&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&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;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&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; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ButtonTest&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot; &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&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;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;I searched the Internet for a solution to this problem and many of the common solutions to the problem I found where to hooked to ItemCreated or DataBound event from the ListView, then using FindControl to find the control and store it in a variable that was part of the page class. While this is entirely doable it leads to really clunky code and there is a much better method for doing this. Controls have the same life cycle methods that the page itself has an by handling the Init event for the button I can get access to the button as soon as it is created and store a copy off that can be used when other parts of the page fire events. &lt;/p&gt;  &lt;p&gt;Here is the change to the markup above:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ButtonTest&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;oninit&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ButtonTest_Init&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;And here is what the code behind looks like:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public partial class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;_Default &lt;/span&gt;: System.Web.UI.&lt;span style="color: #2b91af"&gt;Page &lt;/span&gt;{
    &lt;span style="color: #2b91af"&gt;Button &lt;/span&gt;ButtonTest;

    &lt;span style="color: blue"&gt;protected void &lt;/span&gt;ButtonTest_Init(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e) {
        ButtonTest = (&lt;span style="color: #2b91af"&gt;Button&lt;/span&gt;)sender;
        ButtonTest.Text = &lt;span style="color: #a31515"&gt;&amp;quot;Foo&amp;quot;&lt;/span&gt;;
    }

    &lt;span style="color: blue"&gt;protected void &lt;/span&gt;ListView1_ItemDeleted(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;ListViewDeletedEventArgs &lt;/span&gt;e) {
        ButtonTest.Text = &lt;span style="color: #a31515"&gt;&amp;quot;Add&amp;quot;&lt;/span&gt;;
    }

}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;The ButtonTest_Init event handler stores the button in ButtonTest and changes it's text. You will also note that because I've done this I can now access the button inside other event handlers the ListView may fire, which was my initial goal. All in a very clean manner not hooking ListView events and not calling FindControl.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8337423" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Sample for Displaying Images from the Database using Dynamic Data</title><link>http://blogs.msdn.com/scothu/archive/2008/01/14/sample.aspx</link><pubDate>Tue, 15 Jan 2008 01:59:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7112679</guid><dc:creator>scothu</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/scothu/comments/7112679.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scothu/commentrss.aspx?PostID=7112679</wfw:commentRss><description>&lt;p&gt;I'm posting a sample project that shows some custom field template controls for Dynamic Data that allow images to be viewed/edited from a database. The sample also shows how you can view images that have their filenames in the database but the images on the physical disk. You can download the sample by clicking this download link: &lt;a href="http://www.cshonline.com/dbimage.zip"&gt;DOWNLOAD SAMPLE&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here are the basics sets that are required if you want to add this functionality into you own Dynamic Data project:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;1) Reference the DbImageAPI library in the sample to your Dynamic Data website.&lt;/p&gt;  &lt;p&gt;2) Copy DbImage.ascx., DbImage.ascx.cs, DbImage_Edit.ascx, DbImage_Edit.ascx.cs, FileImage.ascx, FileImage.ascx.cs from the samples App_Shared/DynamicDataFields directory to the App_Shared/DynamicDataFields directory on your website.&lt;/p&gt;  &lt;p&gt;3) Copy the Blank.gif from the samples App_Shared/Images to the App_Shared/Images directory in your website.&lt;/p&gt;  &lt;p&gt;4) In the Web.Config file add &amp;quot;&lt;/p&gt;  &lt;p&gt;&amp;lt;add verb=&amp;quot;*&amp;quot; path=&amp;quot;ImageHandler.ashx&amp;quot; type=&amp;quot;DbImageAPI.ImageHandler&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;quot; to the &amp;lt;httpHandlers&amp;gt; section.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Once these are done you just need to apply renderhints to the data model. For example if the table in the database is Categories you would create a partial class called Category and add the following metadata to the partial class:&lt;/p&gt;  &lt;p&gt;[ImageFormat(&amp;quot;Picture&amp;quot;, 100, 100)]    &lt;br /&gt;[RenderHint(&amp;quot;Picture&amp;quot;, &amp;quot;DbImage&amp;quot;)]     &lt;br /&gt;public partial class Category { &lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The RenderHint tells it to use the DbImage field template control to render the Picture column. There is also an additional attribute added which allows the width and height the image to be set as well. The ImageFormat attribute causes the control the dynamically scale the image keeping the proper aspect ratio.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you have a database column that has filenames of images that exist in a directory in the website you can use the FileImage control. Here is an example:&lt;/p&gt;  &lt;p&gt;[RenderHint(&amp;quot;Filename&amp;quot;, &amp;quot;FileImage&amp;quot;)]    &lt;br /&gt;[ImageUrl(&amp;quot;Filename&amp;quot;, &amp;quot;~/images/{0}&amp;quot;)]     &lt;br /&gt;[ImageFormat(&amp;quot;Filename&amp;quot;, 100, 100)]     &lt;br /&gt;public partial class FilePicture {     &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In this case the table in the database is FilePictures and a partial class of FilePIcture has been created to apply the attributes. The RenderHint tells it to render the Filename column using the FileImage field template control. The ImageUrl attribute is used to specify where on the website the images are located, in this cas the images are in the images directory underneath the root. And once again the ImageFormat attribute is used to specify a width/height. In the case of file based images this attribute just changes the width and height tags on the image.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I will go into much more detail about how these controls were created in a future blog post.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7112679" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scothu/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/scothu/archive/tags/Dynamic+Data/default.aspx">Dynamic Data</category></item></channel></rss>