Validationengine jquery not working properly for localization

前端 未结 1 402
Happy的楠姐
Happy的楠姐 2021-01-23 17:50

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 usin

1条回答
  •  既然无缘
    2021-01-23 18:39

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

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

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

    The Script Manager markup declaration:

    
      
        
      
     
    

    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);
    

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

    0 讨论(0)
提交回复
热议问题