This is my Model property
public ModelStateDictionary modelSateClientSide { get; set; }
Now I called the Property in JavaScript and add the error in my ModelState
if (parseInt(academicAchievement, 10) > parseInt(peAcademicAchievement, 10))
{
@Model.modelSateClientSide.AddModelError(string.Empty, "xxx");
return false;
}
Am I doing it correctly? And I got a error in above line:
The best overloaded method match for System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments.
How can solve this? Any other option to add error message in ModelState on MVC using Javascript?