Validationengine jQuery的不是本地化正常工作 [英] Validationengine jquery not working properly for localization

查看:200
本文介绍了Validationengine jQuery的不是本地化正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery的validationEngine 2.6.2在ASP.NET验证。我想根据所选喜欢英语或日语的语言来加载它的语言规则文件。我使用应用程序中的母版页。给出一些这方面的解决方案。

I am using validationEngine jquery 2.6.2 for validation in ASP.NET. I want to load its language rules file according to the language selected like English or Japanese. I am using master page in the application. Give some solution for this.

推荐答案

您没有说明您是如何在语言选择,以及如何去检查当前选择的语言。

You didn't specify how the language are selected and how you are going to check the current selected language.

要本地化validationEngine,必须引用正确的脚本语言。

To localize validationEngine, you must reference the right script language.

如果您使用脚本管理器,在code你的母版页的背后可以dinamically引用本地化的脚本。

If you use a Script Manager, in the code behind of your Master Page you can reference dinamically the localization script.

脚本管理器标记声明:

<asp:ScriptManager ID="scrManager" runat="server">
  <Scripts>
    <asp:ScriptReference Path="~/js/jquery.validationEngine.js" />
  </Scripts>
</asp:ScriptManager> 

然后你就可以动态地添加你的语言脚本(code后面):

Then you can add dynamically your language script (code behind):

ScriptReference validationEngineLanguage = new ScriptReference();
// #### Assign the correct script reference based on the selected language #####
validationEngineLanguage.Path = "~/js/jquery.validationEngine-en.js";
this.scrManager.Scripts.Add(validationEngineLanguage);

要dinamically引用脚本另一种选择是获得codebehind标签参考,并添加脚本标记。

Another option to dinamically reference the script would be get the tag reference in codebehind and add the script tag.

这篇关于Validationengine jQuery的不是本地化正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆