ASP.NET - Resx file for aspx - Asked By mostafa hamdy on 27-Feb-12 04:43 AM

Hello all
I have some web site contains many aspx files and I want to add .resx file for each aspx file but I dont want to attache it to the App_GlobalResources Folder or App_LocalResources Folder I mean I want under aspx file I want to have an aspx ,aspx.cs and aspx.resx file to more orgnized please if any body get what I mean and can help me please send me or tell me about some URL may help me in solving it
regards
Mostafa
kalpana aparnathi replied to mostafa hamdy on 27-Feb-12 04:52 AM
hi,

To generate a global resource file in Visual Web Developer

  1. In Solution Explorer, right-click the name of the Web site, click Add New Item, and then click Resource File.

    Visual Web Developer asks you if you want to place the file in the App_GlobalResources folder, and offers to create the folder.

  2. Click Yes.

  3. Type values for each resource that you need in your application, and then save the file.

  4. If the latest resource changes are not displayed, refresh Design view by switching to Source view and then switching back to Design view.

  5. To create resource files for additional languages, copy the file in Solution Explorer or in Windows Explorer, and then rename it using one of the following patterns:

    name.language.resx

    name.language-culture.resx

    Read more:click here

    Regards,


Somesh Yadav replied to mostafa hamdy on 27-Feb-12 04:55 AM
hi,

You can instantiate a ResourceManager, that you point to a set of resource
files,
(for the different supported cultures). Then it is possible te retrieve
texts and
binary information as specific as possible for the current culture.
Just as "regular" resource files (add more of those files for the supported
cultures,
instantiate a ResourceManager, point it to the set of resource files, and
use it
for every text that is culture specific; in short: add a lot of coding)
or is there any direct support built-in, which requires (almost) no coding?
(I can imagine a feature where label-texts and so on are automatically
replaced by a text from the resource, if the label-text happens to be an
existing resource-label)
D Company replied to mostafa hamdy on 27-Feb-12 05:00 AM
hello

When u add a .resx file to your application By default, a new folder that is named App_LocalResources is created. Additionally, a resource file that is named Default.aspx.resx is created.

This file contains information about each Controls . The values in the resource file match the values that you entered for each Controls in Design.

i know this is possible in MVC project  u can try this use Resx Files Outside Of Special Resource Directories. and access it from there and If you add a resx file to any other folder in an MVC project or class library, the resx is automatically set to be embedded into the project’s output assembly

for more detail read this article


hope its clear
Regards
d
Suchit shah replied to mostafa hamdy on 27-Feb-12 06:51 AM
Global resource files must be in the App_GlobalResources folder. If you try to create a .resx file outside of this folder, Visual Web Developer prompts you to create it in the folder.

You can create any number of subfolder but Global resource file you have to put inside App_GlobalResource folder and Local resource file inside App_LocalResource folder only