asp.net mvc 2 - Creating custom Html helper for datepickerfor(model=>model.date) from model -


I am making custom HTML support for my datepicker.
I want to pass in mode because it's TextBoxFor (model = & gt; model.name)

so what do I want, but I do not know how to do this

  1. Field name
  2. The value of the field

    I have made

      Public stable string date picturefront & lt; TModeel, TProperty & gt; (This HtmlHelper & lt; TModeel & gt; HTMLHelper, expression & lt; Func & lt; TModeel, TProperty & gt; & gt; Expression) {// Return Object. Name var expression text = expression. Helper. GetExpressionText (expression);    

    1. field name

        string fullHtmlFieldName = htmlHelper .ViewContext .ViewData. TemplateInfo .GetFullHtmlFieldName (ExpressionHelper.GetExpressionText (expression));  
    2. The value of the field

        var metadata = modelmatetta.freem LambdaXpress (expression, HTML helper.jyzedata); Object value = metadata.model; // will be type TProperty      

Comments