先來看看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.TextBox()例子: