I have the following domain entity decorated with System.ComponentModel.DataAnnotations:
[HiddenInput(DisplayValue=false)]
public int Id { get; set; }
[Required]
[Display(Name="Last Name")]
public string LastName { get; set; }
[Display(Name = "First Name")]
public string FirstName { get; set; }
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
[Timestamp]
[HiddenInput(DisplayValue=true)]
[ScaffoldColumn(true)]
public byte[] Version { get; set; }
When I render my model in the view using @Html.EditorForModel()
nothing is rendered for the version property. Is there anything that can force EditorForModel()
method to render the byte[]
?
PS: Using @Html.EditorFor(x => x.Version)
works just fine.
A
byte[]
is considered to be a complex type by theEditorForModel
method and there currently is no way for those to be displayed. You could try adding another property to your model (typed asstring
for example) that would read from and write to yourVersion
property.