Html.DescriptionFor<T>

Posted by Stacey on Stack Overflow See other posts from Stack Overflow or by Stacey
Published on 2010-05-23T00:48:29Z Indexed on 2010/05/23 0:50 UTC
Read the original article Hit count: 320

Filed under:

I'm trying to emulate the Html Helper for "LabelFor" to work with the [Description] Attribute. I'm having a lot of trouble figuring out how to get the property from the helper though. This is the current signature...

class Something
{
 [Description("Simple Description")]
 [DisplayName("This is a Display Name, not a Description!")]
 public string Name { get; set; }
}

public static MvcHtmlString DescriptionFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression);

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2