Meta: Analysis of ASP. NET2.0 multi-language localization technology caused by resourcekey

Source: Internet
Author: User

I don't understand either of them. Alas, the knowledge is too lacking and there is no way to do it. Later I checked the information and learned:ASP. NET2.0 multi-language localization technology. Ah!

Reference MSND: Implicit Localization

(1) Make sure that you have local resource files (. resx files) that meet the following conditions: they are located in the App_LocalResources folder. The base name matches the Page name. For example, if you are using the name Default. the resource file is named Default. aspx. resx (for Default resources) and Default. aspx. es. resx and Default. aspx. es-mx.resx and so on. File resource usage naming conventionsResourcekey."Property". For example, the key nameButton1. "Text".

(2) Add an implicit localization attribute to the control tag.

<Asp: Button ID = "Button1" runat = "server" Text = "DefaultText"Meta: resourcekey = "Button1"/>

All resource files are compiled, and ASP. NET uses the. NET Framework resource manager at runtime to search for resources in the default resource file that are suitable for a specific region. For each resource, ASP. NET searches for the correspondingResourcekey."Property"Combination (in the previous exampleResourcekey = "Button1"), And then use the retrieved value to replace the resource.

Note: The intermediate language file generated by CLR is your code *. cs or *. file generated by vb .. NET FrameWork does not know *. cs or *. vb file, only know *. resx file.Resource files are used in Multilingual Systems.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.