Silverlight 4 中带有异步验证的恼人异常(RIA 服务)
我已经为我的 Sivlerlight 项目设置了自定义验证。有一个网格,它通过访问服务器并在域服务中执行检查来确保条目是唯一的。
该属性被赋予属性来告诉它使用自定义验证器,并且该验证器调用 DomainService 中名为“IsUserNameUnique”的函数。
现在,问题是这样的:我遇到异常,程序死了。如果我分离该项目,我会收到三个错误消息(它们都说相同 - 'isUserNameUnique' 验证失败。请检查操作上的 ValidationErrors 以了解详细信息)。如果我点击它们,我看到的是我的网格和我想要的验证消息!所以我的意思是它有效......有点。它只是有这些我不希望我的最终用户看到的异常。
有什么建议吗?
I've set up a custom validation for my Sivlerlight project. There's a grid, and it makes sure the entry is unique by going off to the server and performing a check in the DomainService.
The property is given the attribute to tell it to use the custom validator, and that validator calls a function in the DomainService called 'IsUserNameUnique'.
Now then, the problem is this: I get an exception and the program died. If I detatch the project, I get three error messages (they all say the same - 'isUserNameUnique' failed validation. Please inspect ValidationErrors on the operation for details). If I click through them, what I see is my grid and the validation message I wanted! So I mean it works... sort of. It just has these exceptions that I don't want my end user to see.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否将此自定义验证指定为 Viewmodel 属性的属性?验证您的绑定是否已正确创建(相应设置了 ValidatesOnExceptions、NotifyOnValidationError)。
代码示例也会有帮助。
Are you specifying this custom validation as an Attribute for a Viewmodel property? Verify that your binding is created properly (ValidatesOnExceptions, NotifyOnValidationError is set accordingly).
A code example would be helpful too.