I show 3 or more versions of the form. One version is an editing form for editing all fields. The second version will be a read-only version of the same form that will be used to display all the same fields, but with all fields having readonly = "true" on the client side, so that the user can not enter data. For readonly fields, you must use a different css style. It displays archived data. I already hide the submit button so that they cannot submit, but I want the form to look like it is read-only. The third version will have some read-only fields and some editable for a certain class of users with limited editing rights.
I am using ASP.NET MVC 1.0. How to change all (or a subset) of displayed fields so that they are read-only. I would like to iterate through a collection of fields in the controller and set them all to read, and also set the correct css class. I don’t want to include an if statement in every field in the .aspx file (there are 40-50 fields), and I would prefer not to have this on the client side so that I can prevent users from changing javascript / html to edit things that they shouldn't.
TIA
Steve sier
Steve shier
source
share