xval 从资源文件获取消息
我正在开发一个 CMS 系统,该系统使用资源文件来获取信息和错误消息。客户端验证工作正常,没有问题,只是没有从资源文件中获取错误消息。在调试时,我发现 xval 似乎从 javascript 文件中获取错误消息,其中消息被设置为硬编码。有什么方法可以覆盖这个吗?
在应该与资源文件建立关系的代码下方,指定字段留空时的错误。
[Property]
[Required(ErrorMessageResourceType = typeof(CMSMessages), ErrorMessageResourceName = "EnterValidMoney")]
public virtual Double ShippingCost { get; set; }
I'm working on a CMS system which uses a resource file to get information and errormessages from. The client side validation is working without problems, only it's not getting the errormessage from the resource file. While debugging i figured out xval seems to get the errormessages from a javascript file where the messages are set hard-coded. Is there some way to override this?
Below the code which should make the relation to the resourcefile en specify the error when the field is left empty.
[Property]
[Required(ErrorMessageResourceType = typeof(CMSMessages), ErrorMessageResourceName = "EnterValidMoney")]
public virtual Double ShippingCost { get; set; }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
xVal 附带了一堆消息 JS 文件(在可选/国际化文件夹中),但似乎没有关于如何使用它们的文档!
看起来您只需要包含一个
xVal comes with a bunch of message JS files (in the Optional/Internationalization folder) but there appears to be no documentation on how to use them!
It looks like you simply need to include a <script src="..."> block after the min library is inluded.