locked
Custom Local resource RRS feed

  • Question

  • User1929745068 posted

    Hi...

    I have created a Page( first.aspx ) and created a local resource ( first.aspx.resx ) for that  which resides in App_LocalResources.

    I have added one more custom.resx file in same App_LocalResources folder.

    Can anyone guide me on how to access the key value pair from custom.resx file in code behind

    thanks

    Wednesday, October 18, 2006 1:41 AM

All replies

  • User-503940700 posted

    Hi,

    App_LocalResources is used for page specific resource files. Creating a custom named file in this folder is not recommened. Why do you need to use it?

    -Vivek

    Wednesday, October 18, 2006 2:17 PM
  • User1929745068 posted

    all multiligual sites have their local_Resource files.

    There are some country specific settings are to be done. which have to be modified from outside.

    either I can put it in GlobalResources or LocalResources. If i put the settings in globalresources then the files will get compiled while deployment so I can not change the settings. So the other oprion is to put the settings in some LocalResource files.

    I am not in favour of XML files because it will add some extra processing on the site which I want to avoid.

    Wednesday, October 18, 2006 11:43 PM
  • User-503940700 posted

    >There are some country specific settings are to be done. which have to be modified from outside.

    >either I can put it in GlobalResources or LocalResources. If i put the settings in globalresources then the files will get compiled while deployment so I can not change the settings. So the other >oprion is to put the settings in some LocalResource files.

    >I am not in favour of XML files because it will add some extra processing on the site which I want to avoid.

    Even resource files are XML files and incur the same overhead as normal XML files (the advantage being that the wrapper classes are generated automatically by the runtime). AFAIK, you cannot access custom files under App_LocalResources programmatically. So I would either use:

    1. A Web Application Project where I can put raw XML files and access them programmatically in the App_GlobalResources folder.

    2. Custom XML file in a separate folder.

    3. a DB and a GUI.

    HTH,

    Vivek

    Friday, October 20, 2006 2:47 PM
  • User-524892161 posted

    hi,

    how can we use raw xml file from the App_GlobalResources

    Thursday, December 14, 2006 4:51 AM
  • User-503940700 posted

    hi,

    how can we use raw xml file from the App_GlobalResources

    For that you need to use the Web Application Project option instead of the Website project model (which is default in VS 2005). If you are using the Website model, then resource files only under the App_LocalResources will get published as raw .resx files on the server. These can be edited on the server dynamically. Files under the App_GlobalResources folder are compiled as a single dll (App_GlobalResources.dll) and published on the server, so you cannot edit the resource files which are under App_GlobalResources once they have been published.

    If you are using a Web Application Project, then files both under the App_GlobalResources as well as App_LocalResources folders will get published as raw .resx files which are editable. So using WAP gives you this flexibility which the default Website model does not provide.

    Hope this helps,

    Vivek

    Thursday, December 14, 2006 7:19 AM
  • User-524892161 posted

    Hi,

    thanks for your reply.

    i could not find any type of project "Web Application Project".  then i searched on the net by this keyword i found that i have to install an update for my VS2005 to support web application project.

    i updated it, but i could not also achive that.

     please, can you advice me.

    Wednesday, December 20, 2006 12:59 AM
  • User-524892161 posted

    Ok Thanks

    I got it.

    Wednesday, December 20, 2006 1:27 AM