This question is locked. New answers and comments are not allowed.
Hi,
I'm trying the model state error handling sample in code library (235124_modelstateerrors).
I upgraded it to 2011.3 and played with it.
I found some issues below.
1) "jquery.validate.js" version in 2011.3 is 1.8, it sometimes not working properly with "jquery.validate.unobtrusive.js", i replaced it with version 1.9 and everything seems ok
2) if I added model error with empty key, for example:
ModelState.AddModelError("", "ModelState error added");
javascript error occured in telerik.grid.editing.js (in displayErrors function):
"Syntax error, unrecognized expression: #"
(I patched "resolveWith" in jquery-1.6.4.js to show this error message. otherwise it would say "exception thrown without catch" in visual studio debugger)
3) if I added more than one model error for same field, but only first one displayed
ModelState.AddModelError("Name", "ModelState error added for the Name property");
ModelState.AddModelError("Name", "ModelState error2 added for the Name property");
I guess it's designed behavior, but it would be better if the case could be handled.
Please find attached project to simulate issue 2) and 3).
Regards
WIcky
I'm trying the model state error handling sample in code library (235124_modelstateerrors).
I upgraded it to 2011.3 and played with it.
I found some issues below.
1) "jquery.validate.js" version in 2011.3 is 1.8, it sometimes not working properly with "jquery.validate.unobtrusive.js", i replaced it with version 1.9 and everything seems ok
2) if I added model error with empty key, for example:
ModelState.AddModelError("", "ModelState error added");
javascript error occured in telerik.grid.editing.js (in displayErrors function):
"Syntax error, unrecognized expression: #"
(I patched "resolveWith" in jquery-1.6.4.js to show this error message. otherwise it would say "exception thrown without catch" in visual studio debugger)
3) if I added more than one model error for same field, but only first one displayed
ModelState.AddModelError("Name", "ModelState error added for the Name property");
ModelState.AddModelError("Name", "ModelState error2 added for the Name property");
I guess it's designed behavior, but it would be better if the case could be handled.
Please find attached project to simulate issue 2) and 3).
Regards
WIcky