Answer the question
In order to leave comments, you need to log in
How to accept only Russian from the form?
How in asp.net to accept only the Russian language in the model (the form returns the last name)?
[DataType(DataType.Text)]
[Required(ErrorMessage = "Не указана фамилия")]
public string Surname { get; set; }
Answer the question
In order to leave comments, you need to log in
Regex.IsMatch("^[А-ЯЁ]{1}[а-яё]+$", Surname);
In this format, we check both the correctness of the character set and the correctness of the entered surname - with a capital letter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question