I have a view in MVC3 with a TextBoxFor bound to my model like so:
<%=Html.TextBoxFor(m => m.SomeProperty, new { @readonly = "readonly" }) %>
How could I change this to be a textbox which would have style="display: none;" by default?
asp.net-mvc-3view
I have a view in MVC3 with a TextBoxFor bound to my model like so:
<%=Html.TextBoxFor(m => m.SomeProperty, new { @readonly = "readonly" }) %>
How could I change this to be a textbox which would have style="display: none;" by default?
Best Answer
Not sure what you mean by default, but you could add the style attribute:
or:
and in your CSS file: