As the name suggests, this attribute is used to make a property read only .But when we submit the form, the default model binder in ASP.NET MVC will not move that value from the posted form values to the class properties. c asp.net-mvc-3 razor html-helper readonlyattribute | this question edited Jan 6 12 at 21:51 user596075 asked Jan 6 12 at 17:13 Shyju 105k 73 268 388.Recommendc - How to render partial Page in ASP.Net mvc3 Razor. age ,but enable only after the action calls.But both files are The different ways how we can make a text box read only as mentioned below: 1. Using the read-only attribute in the TextBox HtmlHelper, i.e. Html.TextBoxFor(Model > Model.Customer, new readonly readonly ). April 2018 : Instructor-led Online Courses in ASP.NET MVC / Core and Design Patterns Read moreFor the sake of simplicity the above code uses only four properties form the Customer model class. So, all the textboxes having same index are considered as "one record". Professional ASP.NET MVC 4 (3). Posted on October 28, 2012 by lesleyjudy.GET read-only operation. Does not change state on server.You can also do this: Passing a Album object to ViewBag Create a textbox based on Albums Price Generated Html.TextBox Conditional Attribute With ASP.NET MVC Preview 5.
It seems that no matter what value I give the readonly attribute (even "false" and ""), Firefox and IE7 make the input read-only, which is annoyingly counter-intuitive.