# Blazor Web Element & Validation ```html= InputCheckbox => <input type="checkbox"> InputDate => <input type="date"> InputNumber => <input type="number"> InputFile =><input type="file"> InputSelect => <select> InputText => <input> InputTextArea => <textarea> InputRadio<TValue> InputRadioGroup<TValue> =><input type="radio"> ```   ```c#= public class Employee { public int EmployeeId { get; set; } [Required] [MinLength(2)] public string FirstName { get; set; } [Required] public string LastName { get; set; } [EmailAddress] public string Email { get; set; } // Rest of the properties } ```  ```C#= public class Employee { [Required(ErrorMessage = "FirstName is mandatory")] [MinLength(2)] public string FirstName { get; set; } // Other properties } ``` 在ValidationMessage使用For可以直接放lambda表達式 ```html= <EditForm> <p> <label for="productionDate">Production Date: </label> <InputDate id="productionDate" @bind-Value="starship.ProductionDate" /> <ValidationMessage For="() => starship.ProductionDate" /> </p> <button type="submit">Submit</button> </EditForm> ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up