Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am getting an errors that Model.IsValid == false.

Here is one of the property with an error:


C#
// Property

[RegularExpression(@"^[0-9]*$", ErrorMessage = "Invalid number")]
public List<string> Numbers { get; set; }

//Constructor

public ClassName()
{
 Numbers  = new List<string>();
}


Can someone explain me why? Do I need to validate each element of the List? How to achieve it?

What I have tried:

I tried to debug the problem and searched google but didn't find anything usefully.
Posted
Updated 6-Feb-17 20:01pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900