I have the following view,, which create 10 ajax.beginform ,, But the problem that i am facing is that incase an error occurs during the creation of the object then the Mode
You can use from ViewData dictionary in View to access ModelState data.
ViewData
ModelState
For example:
in Action:
ModelState.AddModelError("CustomError", "Error 1"); ModelState.AddModelError("CustomError", "Error 2");
and to get "Error 1" message:
ViewData.ModelState["CustomError"].Errors[0].ErrorMessage