public static System.Web.Mvc.MvcHtmlString HiddenForDateTime <TModel, TValue> (this System.Web.Mvc.HtmlHelper <TModel> htmlHelper, System.Linq.Expressions.Expression <System.Func <TModel, TValue> > expression) where TModel : class { var varMetadata = System.Web.Mvc.ModelMetadata.FromLambdaExpression (expression, htmlHelper.ViewData); //var varMetadata = // System.Web.Http.Metadata.ModelMetadata.FromLambdaExpression // (expression, htmlHelper.ViewData); var varValue = varMetadata.Model; return(htmlHelper.HiddenForDateTime(expression, varValue)); }