I have a view model like so:
public class AccountView {
public int AccountId { get; set; }
[Required]
public string AccountName { get; set; }
}
But I would like the AccountName field to be required only if the action is "Edit", but not "Create". How is this accomplished in asp.net mvc3?
thanks.