阅读背景:

验证对象然后使用CustomValidator显示错误

来源:互联网 

I'm hoping someone can help me. I want to write custom validation code on directly on the object rather than have to write separate methods for both the website UI and a web service which is using the same objects. Here is the code I have at present, which works but I don't think is the best solution, especially as it means having to use an object where I really just want to use standard string / int etc. I had thought that maybe I could use an attribute on the property of the object but as I can't set the value of the attribute that idea went out the window. Any help would be gratefully received.I'm hoping someone can help me. I want to write




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: