UIHint Attribute in MVC
问题 What is Use of UIHint Attribute in MVC . Can anyone please provide me a simple example of how to use it and what it does. 回答1: When using a Display or Editor template, UIHint will tell it which template to use: [UIHint("SomeTemplate")] public class MyViewModel { public string SomeProperty { get; set; } } If you create a Display template called SomeTemplate.ascx (since you are MVC2) in the Views/Shared/DisplayTemplates or Views/{Controller}/DisplayTemplates then it will use that template when