ASP.NET Dynamic Data geekSpeak Q&A and Follow Up

Below are a list of questions directly from my geekSpeak session earlier this week.

Q: How do you hide a class from the scaffolding?

A: Use the ScaffoldTableAttribute on the class in your data model you want to hide.

[ScaffoldTable(false)] public partial class Products {}

 

Q: If you are using regex validation, can you specify the expression in the model?

A: You sure can. You can use the RegularExpressionAttribute to decorate the field in the Meta model. Here’s an example:

public class CustomerMetaData
{ // Allow up to 40 uppercase and lowercase characters
[RegularExpression(@"^[a-zA-Z''-'\s]{1,40}$", ErrorMessage = "Numbers are not allowed.")] public object FirstName; }

 

 

Q: How do you use the UI Hint Attribute to specify a custom field template?

A: [Updated] Answered, Creating Custom Fields in ASP.NET Dynamic Data

Q: Can you demonstrate an example of how to tap into LINQ to SQL events for validation?

A: I’m currently writing a post to answer this*

*Expect the posts this week answering the two previous questions; and I’ll update this post to reflect that.

 

What links were mentioned during your geekSpeak session?

Dynamic Data Forums: http://forums.asp.net/1145.aspx

Dynamic Data website: http://www.asp.net/dynamicdata/

ASP.NET & ASP.NET Dynamic Data Team Member Sites:

Scott Hanselman’s videos/screencasts: http://www.asp.net/dynamicdata/

Scott hunter’s blog: http://blogs.msdn.com/scothu

Brad Wilson’s blog: http://bradwilson.typepad.com/

David Ebbo’s blog: http://blogs.msdn.com/davidebb/

Marcin Dobosz’s blog: http://blogs.msdn.com/marcinon/

Article - How to Integrate Dynamic Data into existing sites:

http://blogs.msdn.com/scothu/archive/2008/06/24/how-to-add-dynamic-data-to-an-existing-web-application.aspx