Analysis of asp.net2.0 localization technology caused by Meta:resourcekey

Source: Internet
Author: User
Tags naming convention

In fact, I just look, also do not understand. Alas, the knowledge is too short, there is no way, then check the data learned:asp.net2.0 localization technology . Hey!

Referencing msnd: implicit localization

(1) Ensure that you have local resource files (. resx files) that meet the following criteria: They are located in the App_LocalResources folder. The base name matches the page name. For example, if you are using a page named Default.aspx, the resource file is named Default.aspx.resx (for the default resource), Default.aspx.es.resx, Default.aspx.es-mx.resx, and so on. The resources in the file use the naming convention resourcekeyProperty ." " . For example, the key name Button1."Text" .

(2) in the control tag, add an implicit localized property.

<asp:button id= "Button1" runat= "Server" text= "DefaultText" meta:resourcekey= "Button1"/>

All resource files are compiled, and ASP.net uses the. NET Framework Explorer at run time to retrieve culture-appropriate resources for each resource in the default resource file. For each resource, asp.net finds the corresponding resourcekeyproperty ." " combination (in the previous example) in the page resourcekey="Button1" , and then replaces the resource with the retrieved value.

Note: The CLR-generated intermediate language file is the file that will generate your code *.cs or *.vb. The. NET framework does not recognize *.cs or *.vb files and only recognizes *.resx files. resource files are used in the development of multilingual systems . </

Related Article

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.