Hello,
There seem to be several examples dotted around the place on how to handle Model State errors
e.g. How do I display model state errors?
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/faq
However I cannot find any documentation on how to create the error on the server in the first place.
Any hint of what needs to replace the comments shown below, would be much appreciated.
Regards,
Pete
There seem to be several examples dotted around the place on how to handle Model State errors
e.g. How do I display model state errors?
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/faq
However I cannot find any documentation on how to create the error on the server in the first place.
Any hint of what needs to replace the comments shown below, would be much appreciated.
Regards,
Pete
[AcceptVerbs(HttpVerbs.Post)]
public
ActionResult Update_User([DataSourceRequest] DataSourceRequest request, UserProfile userprofile)
{
if
(userprofile !=
null
&& ModelState.IsValid)
{
if
(errorcondition)
{
//raise something here that will be picked up by the onError function described above
//to inform the user that some sort or error occured
}
}
else
{
//raise something here that will be picked up by the onError function described above
//to inform the user that the ModelState.IsValid is Invalid
}
return
Json(ModelState.ToDataSourceResult());
}