Html.TextareaFor in partial view C#
<p>In our application we use HtmlHelpers and partial views to create components.  For the Commentbox component, how can I generate a textbox using a given model property?
The code below is the holy grail, but gives some errors.</p>

<p><strong>Code (simplified)</strong></p>

<p><em>/Views/Comment.cshtml (the page)</em></p>

<pre><code>@Html.Commentbox(m =&gt; m.Message);
</code></pre>

<p><em>/Extensions/HtmlHelper.cs (the intermediate helper)</em></p>

<pre><code>public static MvcHtmlString FormTextbox&lt;TModel, TProperty&gt;( this HtmlHelper&lt;TModel &gt; htmlHelper,
       Expression&lt;Func &lt;TModel , TProperty &gt;&gt; CommentboxExpression, CommentboxViewModel model = null)
{
    if (model == null) { model = new CommentboxViewModel(); }
    model.ModelItem = CommentboxExpression;
    return htmlHelper.Partial( "Components/Commentbox", model);
}
</code></pre>

<p><em>/ViewModels/Components/CommentboxViewModel.cs (the ViewModel)</em></p>

<pre><code>namespace ViewModels.Components
{
    public class CommentboxViewModel
    {
        public LambdaExpression ModelItem { get; set; }
    }
}
</code></pre>

<p><em>/Components/Commentbox.cshtml (the component partial view)</em></p>

<pre><code>@model ViewModels.Components.CommentboxViewModel
@Html.TextAreaFor(Model.ModelItem)
@Html.ValidationMessageFor(Model.ModelItem)
</code></pre>

<p><strong>What doesn't work:</strong></p>

<ul>
<li><code>@Html.TextAreaFor(m =&gt; m.ModelItem)</code> (in partialview) -> puts "m => m.ModelItem" as value into the textarea box</li>
<li><code>@Html.TextAreaFor(Model.ModelItem)</code> (in partialview) -> gives "The type arguments for method 'System.Web.Mvc.Html.InputExtensions.TextAreaFor(System.Web.Mvc.HtmlHelper, System.Linq.Expressions.Expression>)' cannot be inferred from the usage. Try specifying the type arguments explicitly."</li>
</ul>

<p><strong>What worked:</strong></p>

<ul>
<li>it works using <code>@Html.TextArea()</code>, but then you need to manually add validation attributes.</li>
<li>it works when generating a <code>@Html.ValidationMessageFor()</code> as MvcHtmlString on the ViewModel, but we want to keep as much possible of the rendering in the partial view and possibly nest components.</li>
</ul>

<p><strong>Question</strong></p>

<p>How to get <code>@Html.TextAreaFor(Model.ModelItem)</code> working in the partial view, so it renders a textbox, including all validation attributes?</p>