ASP.NET – Dynamic Data – Read Only Column

This is a simple way to configure columns as Read Only when using Dynamic Data

Make two copies of the Text.ascx field template and name one ReadOnly.ascx and the other ReadOnly_Edit.ascx then annotate the field in your metadata partial class as follows

[UIHint(“ReadOnly”)]
public object UpdateDate;


This works fine as the UIHint uses the ReadOnly field template to display the column in display mode and the ReadOnly_edit template when in in edit mode. Both simply display the column using the aps:Literal control

Leave a Reply

Your email address will not be published. Required fields are marked *