Implementation of ASP. NET localization in gridview

Source: Internet
Author: User

It is quite annoying to be working on a project. In addition, the interface must be internationalized in multiple languages, and the products and other data entered must be supported in multiple languages.
There is still a headache on the interface. Other direct resource source files can be implemented, and the column name of the gridview has encountered a problem. Now there are two solutions:

1. Use the backgroundCodeDynamic Column name modification:
Gridview1.columns [0]. headertext = localizationutility. gettext ("hdractive ");
Advantage: flexible, resource files can be reused. There is no limit on the location of resource files.
Disadvantage: it is complicated to overhead the column, and it is not convenient to match.

2. Bind resource files directly at the front-end
<Asp: boundfield headertext = "<% $ resources: labelresources, headercreatedate" %>
Datafield = "createdate" readonly = "true" sortexpression = "createdate"/>
Advantage: it is convenient to modify the column name and Resource Name.
Disadvantage: This method is only valid for resources on the current page. You must generate a resource file through the design interface of the page, tools/build local resource. I still don't know how this method can reuse multi-language resources. and my resource file is in another project.

PS: change the method as follows:
<Asp: templatefield>
<Headerstyle horizontalalign = "center" width = "150"/>
<Headertemplate>
<% = Localizationutility. gettext ("optionname") %>
</Headertemplate>
<Itemtemplate>
<% # Eval ("optionname") %>
</Itemtemplate>
</ASP: templatefield>

Use ASP. net. it is quite easy to implement multiple languages using the extjs framework in the previous project. miss. it may be better to implement multiple languages of the gridview. hope to know your advice.

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.