[StringLength(25, ErrorMessage = "The {0} Password length must be at least {2} characters long.", MinimumLength = 3)]
Due to it can't find the index 3 parmerter .
Please have a try.
Best regards,
Jolie
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
[StringLength(25)] :it means that the min length and max length value both is 25;
[StringLength(25, ErrorMessage = "The {0} Password length must be at least {2} characters long.", MinimumLength = 3)]:
It means that the min length value set as 3 ,the max length value still is 25 .and error message is "The {0} Password length must be at least {2} characters long.",
it tells us that the specify {0} ,{1}or {2} ,not {3} .
so we can just think the {0} means column name ,the {2} means the min length value, the {1} means the max length value;
Best regards,
Jolie
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
211 Points
904 Posts
Error - Index (zero based) must be greater than or equal to zero and less than the size of the ar...
Mar 25, 2017 09:22 AM|JagjitSingh|LINK
Hi
i am getting above error on below line
Thanks
Contributor
5200 Points
2307 Posts
Re: Error - Index (zero based) must be greater than or equal to zero and less than the size of th...
Mar 25, 2017 01:26 PM|AngelinaJolie|LINK
Hi JagjitSingh,
Please change your code to code below:
[StringLength(25, ErrorMessage = "The {0} Password length must be at least {2} characters long.", MinimumLength = 3)]
Due to it can't find the index 3 parmerter .
Please have a try.
Best regards,
Jolie
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
211 Points
904 Posts
Re: Error - Index (zero based) must be greater than or equal to zero and less than the size of th...
Mar 25, 2017 02:43 PM|JagjitSingh|LINK
Hi
Thanks . Can u please tell me the meaning of this line
[StringLength(25, ErrorMessage = "The {0} Password length must be at least {2} characters long.", MinimumLength = 3)]
Thanks
Contributor
5200 Points
2307 Posts
Re: Error - Index (zero based) must be greater than or equal to zero and less than the size of th...
Mar 27, 2017 03:17 AM|AngelinaJolie|LINK
Hi JagjitSingh,
[StringLength(25)] :it means that the min length and max length value both is 25;
[StringLength(25, ErrorMessage = "The {0} Password length must be at least {2} characters long.", MinimumLength = 3)]:
It means that the min length value set as 3 ,the max length value still is 25 .and error message is "The {0} Password length must be at least {2} characters long.",
And https://referencesource.microsoft.com/#System.ComponentModel.DataAnnotations/Resources/DataAnnotationsResources.Designer.cs,53c08675134a01ce From Microsoft ;
it tells us that the specify {0} ,{1}or {2} ,not {3} .
so we can just think the {0} means column name ,the {2} means the min length value, the {1} means the max length value;
Best regards,
Jolie
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.