The Readonly() property is only available for the Switch control. Please make available the Readonly() property for the TextBox, ComboBox, DropDownList and MultiSelect as well.
Posted on:06 May 2022 12:40
Adding this method would be helpful for everyone. As also specified by Darryl, disabled controls are not passed to the controller via the viewmodel. Consequently having a method directly via razor to specify readonly would be perfect.
Also, it's not even possible to use a static class extension because the HtmlAttributes are cleared when the standard HtmlAttributes function is called. (See request 1 and 2, and an example stackoverflow)