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()例子:

 

它们有什么区别:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM