0

Hi I just got question where i need to assign the error messages for my model validation from key value pair, i tried with the ModelState.AddModelError("TaskName","Error Message"), but i need some thing more reliable and Error messages are residing in database.

So any luck from my friends out there.

Thanks in advance

Nandish Hosmane
  • 107
  • 2
  • 18
  • 3
    Whats wrong with `ModelState.AddModelError("TaskName","Error Message")` and why don't you think its reliable? –  Dec 05 '14 at 04:35
  • @Stephen sorry , every time i need to use this logic to so i thought it would increase code, so is there any way where i can read it from key value pair during model creation itself.. to ErrorMessage Property? – Nandish Hosmane Dec 05 '14 at 04:39
  • What sort of messages are you talking about. Why can't they be handled by ValidationAttributes on your properties? Perhaps an example might help so we can understand the issue. –  Dec 05 '14 at 04:43

0 Answers0