How can you use INotifyDataErrorInfo/ValidationSummary for server side validation?

人走茶凉 提交于 2019-12-25 02:25:00

问题


I have various client side validation rules I'm using such as Required on certain fields. I also have some database validation rules such as unique constraints that really need to be done server-side. I've bubbled the error messages back up to the client, but how can I show them using INotifyDataErrorInfo/ValidationSummary?

If at all possible I'd like these errors to be shown in the ValidationSummary control as well as the control/property that caused the error. Is this even possible?


回答1:


here is a post explain Asynchronous validation : http://weblogs.asp.net/fredriknormen/archive/2009/11/22/silverlight-4-and-asynchronous-validation-with-inotifydataerrorinfo.aspx

in your case, you will have to set your additionnal asynchronous ValidationAttribute onto the Class itself ! (witch will add validations errors to your object)



来源:https://stackoverflow.com/questions/6856464/how-can-you-use-inotifydataerrorinfo-validationsummary-for-server-side-validatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!