I need to either mark controls as read-only, disable them or hide them entirely depending on various business rules.
Currently, I am passing an enum along for each property in my view model. I then check the value of enum for each control. This has led to a pretty nasty chunk of Razor. Even with @helper
s the output is pretty nasty.
I am wondering if there is a better way to alter the appearance of a control based on business rules. Most of the time, I am just adding attributes. In the worst case, I am not displaying a control at all.