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