ASP.NET MVC的TextBoxFor()和TextBox()

先来看看2者的语法:
TextBoxFor():
MvcHtmlString Html.TextBoxFor(Expression<Func<TModel,TValue>> expression, object htmlAttributes)

TextBox():
MvcHtmlString Html.TextBox(string name, string value, object htmlAttributes)

下面Insus.NET举个列子来演示,先创建一个models:


Html.TextBoxFor()例子:



Html.TextBox()例子:

它们有什么区别:

原文地址:https://www.cnblogs.com/insus/p/5310819.html