ASP.NET Dynamic Data Custom Form Formatting

Please install Silverlight or click download to watch video locally.

In this video you will gain some insight on how you can configure the visual aesthetics of a Dynamic Data application down to the very specifics of each field's display.

Presented by Joe Stagner

Duration: 6 minutes, 57 seconds

Date: 11 December 2008

Watch    Video   |   Download    Video   |   VB Code    C# Code

Video downloads: WMV  |  Zune  |  iPod  |  PSP  |  MPEG-4  |  3GP

Audio downloads: AAC  |  WMA  |  MPEG-4  |  MPEG-3  |  MPEG-2

Comments : 6

Leave a Comment

mjta : On December 22, 2008 12:36 PM said:

Joe...good stuff...can we get a video showing how to access specific records from a database for the Logged In User that uses the ASP.NET Membership Provider?

Ragan : On December 26, 2008 5:21 PM said:

Joe

Can we see how to proceed when we have a change in our database? I mean if a new field is added what's the correct process to apply the change to LINQ?

Regards

JJ60764 : On February 06, 2009 1:11 PM said:

Two very good points already included.

My comment is more releated to the

.NET Framework 3.5 Enhancements Training Kit update for SP1

The first DD lab contains this line:

7. Apply the DisplayName attribute to the ProductNumber property. To do this, add the following code above the property definition.

[DisplayName(”Code”)]

private object ProductNumber { get; set; }

Unfortunately, DisplayName is not a viable attribute. It seems as this didn’t make it into the official sp1 release. It is sorely needed however, as everyone often has to give a column a “friendly name” instead of the straight-up database column name.

Can a future video show what can be used instead?

Thanks!

JJ60764 : On February 06, 2009 1:34 PM said:

I posted my issue to the forum and received a very prompt response. Sorry for littering on your video page.

klawonk : On March 06, 2009 5:11 PM said:

I would also like to see the process when your database changes. I have tables that have multiple foreign keys that point to the same table (used for a pull down – IE LensFront and LensBack both point to the Lens table). When you drop the DB schema into VS, it creates name like lens1 and lens2 instead of LensFront and LensBack (obviously, it wouldn’t know how to name them). My problem is, every time the DB schema changes, I have to go back and change the names. I would think VS should be smart enough to determine that only an column was added, so it will keep the foreign key names. Not sure if you follow or not.

In any case, great videos! I have learned a lot.

Thanks

KevinK

the_N_Channel : On July 13, 2009 1:13 AM said:

Great video, but I think there are some more advanced uses of the DataAnnotations that could use some further elaboration, especially in DynamicData websites since it is so templated and annotation driven.

For example, I have a Customers table that has separate columns for first and last names. It has a 1:M relationship with both Orders and Phones. In the default Dynamic Data website, the display field for the foreign key will be the first name column. That's obviously problematic, so what I would like is for the full name to be displayed instead.

At first, I thought I would need to play with the auto-generated templates or create a slew of custom pages. But it it's far easier than that...

In this use-case, all one needs to do is create a partial class for the table in question, add a public property to the class that exposes the desired information, and then use the DisplayColumn annotation (http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displaycolumnattribute.aspx) to the user-defined property.

Perhaps a series of mini-videos for data annotations are in order, or a reference to other tutorials where one finds more information about them (I imagine in ADO.NET Entity Services they appear a lot, though I haven't seen those yet) would be a good thing to include in subsequent videos!

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities