Possible Duplicate:
.NET: What are attributes?
What do the square brackets mean in the following code:
public class LoginModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
I have read in other questions that they are attributes, but I don't know how they work..why do they appear in this class? And are these only used in C#?