Unplanned
Last Updated: 06 May 2022 12:40 by Nicola
Peter
Created on: 11 Oct 2019 10:05
Category: UI for ASP.NET MVC
Type: Feature Request
4
MVC ReadOnly property
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.
2 comments
Nicola
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)
Darryl
Posted on: 01 Mar 2022 17:18

Only having 'disabled' is insufficient.

Disabled fields do not post with the form.

Please add ReadOnly properties to these controls