Thursday, August 11, 2011

Auto generate a local resource file

Local resource files are specific to a particular web page. The base resource file which will be the default option if the resource file for the requested locale is named as Test.aspx.resx. The locale specific files are named as Test.aspx.en.resx or Test.aspx.en-gb.resx (with the culture).

You can create a base resource file using the following steps:
  1. In Visual Studio, go to the web page (Ex: Test.aspx)
  2. Tools > Generate local resource
  3. The resource file will be generated under App_LocalResource folder
  4. In mark up, you can see the new attribute "meta:resourcekey" which will be used to reference the text values.

1 comment:

  1. Thanks for such a nice and updated information. I got some interesting tips from this post.
    Sony Laptops