c# - How to set a default value with Html.TextBoxFor? -


Simple question, if you use HTML Helper from ASP.NET Framework 1, then it's easy to set a default value The text box is because there is a surcharge Html.TextBox (string name, object value) . When I tried to use the Html.TextBoxFor method, my first guess was that it should not work:

  <%: HTML .TextBoxFor (x = & gt; x.Age, new {value = "0"})%>  

Should I stay with HTML.TextBox (string, object) for now?

You can try it

    

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -