有一個模型:我如何只使用顯示模板進行實地
public class SomethingViewModel
{
[Required]
[Display(Name = "Customer")]
public string SomethingName { get; set; }
[Required]
[Display(Name = "Something id")]
public string SomethingId { get; set; }
}
我需要Html.EditorForModel
創建的看法,但我需要現場SomethingName只顯示(標籤)。這個怎麼做?
更新:我需要使用屬性
檢查這個http://stackoverflow.com/questions/6365633/what-is-the-html-displayfor-syntax-for – 2013-03-12 12:59:12