2011-09-29 119 views

回答

4

您可以创建扩展方法(静态类),例如:

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; 
     }