Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set TextBoxFor to be hidden by default

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?

like image 305
Stian Avatar asked Jan 10 '12 08:01

Stian


1 Answers

Html.TextBoxFor(m => m.SomeProperty, new { @readonly = "readonly", @hidden="true"})
like image 177
Piauhy Avatar answered Sep 20 '22 15:09

Piauhy