Model Binding With Disabled Textbox

前端 未结 7 1991
余生分开走
余生分开走 2020-12-09 07:23

I have a textbox that I am defining as

<%= Html.TextBox(\"Username\", Model.Form.Username, 
        new { @class = \"textbox\", @disabled = \"disabled\" }         


        
7条回答
  •  有刺的猬
    2020-12-09 08:09

    @readonly = true does not work on my page. I did additional research. Here is the article that explains it

    ReadOnly attribute doesn't work in ASP.NET MVC Models

提交回复
热议问题