Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
1 like 0 dislike
1.3k views
in .Net Framework by 39 42 54

I am developing an MVC (Model-View-Controller) solution, and I want to create a resource file within the MVC framework. This resource file should allow me to make changes in a single location and have those changes impact the entire project.

 How can I create a Resource file in MVC solution?


1 Answer

1 like 0 dislike
by 39 42 54
 
Best answer

Create Resources files in MVC Step by Step

To generate resources files in MVC ,you should follow the below steps:

  1. In the project structure, navigate to the App_GlobalResources folder, and within this folder, create two resource files: one named Labels.resx and the other named Messages.resx.

App_GlobalResources
2. In the Labels.resx file, define multiple name-value pairs that are used throughout my application.

Resources file
3. Access the LoginTitle from the resource file.

    @Resources.Labels.LoginTitle
If you don’t ask, the answer is always NO!
...