asp.net-mvc-2-metadata

How-to set the Description property of the ModelMetadata

I've putted a Description attribute on my property,but the Description property on the ModelMetada is null anyway. [Description("sss")] public int Id { get; set; } BTW Is I've putted corect? EDIT I've had a look at the MVC source. It doesn't seem to be a bug. The decsription attribute is just never used. There is a property in the ...

DataAnnotations over WCF

I'm sending a DTO over wire (WCF) which has on one property the DisplayName atribute from System.ComponentModel and on a other one the ScaffoldColumn attribute. On the client I have a ASP.NET MVC 2 app and I use the Html.EditorFor(x=>x.DTO) extension method.When the page is rendered it looks like the attributes wasn't there. The DTO [S...

Using Generic Types with MVC2 Templates

I have a model class that is a generic type. I would like to create a custom editor template that would display it (and put it in the Shared folder). How can I do that? I can't figure out how to name it so that MVC2 would pick it up over the generic template. Additionally I am wondering if there is a way to explicitly specify which t...

ASP.NET MVC2 - Determine which type of template is being rendered

Instead of using DisplayFor and EditorFor, I would like to create a more generic ContentFor. In that Html extension it would take into account Metadata values to determine how to render the resulting control. The only piece of the puzzle I am not am to determine is this: Is there a way to determine if I am currently rendering a Displa...