Link to home
Start Free TrialLog in
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

asked on

Display warning message

Hi Experts,
My view model has this code.


[Required]
[StringLength(50, ErrorMessage = "Your business email address may not exceed 50 characters.")]
[Email]
[DataType(DataType.EmailAddress)]
[DisplayName("Business email")]
public string BusinessEmail { get; set; }

Open in new window



is it possible to add another  'not Required'  warning message when the EmailAddress contains a commercial domain. (For ex: if the email address is "test@yahoo.com" then there should be an warning message.

Please help!!
Avatar of Darren
Darren
Flag of Ireland image

Hi

Could you write your own custom validator for the email address and check both email and check for a set of domain names. You would probably need an exhaustive list of domains.

Thanks,

Darren
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

ASKER

Yes, I want something like that.
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial