What is the best way to extend Html Helper TextboxFor? Is there a way to reuse the defautl implementation?
1 Answer
You can create your extension methods (in a static class), for example:
public static MvcHtmlString MyTextBoxFor<TModel, TProperty>(this HtmlHelper<TModel> helper, Expression<Func<TModel, TProperty>> expression)
{
// call original method
MvcHtmlString result = InputExtensions.TextBoxFor(helper, expression);
// do modification to result
return result;
}