Solved

How to work with resx files in ASP.NET MVC 5

Posted on 2016-08-31
4
98 Views
Last Modified: 2016-10-22
I'm wondering how to retrieve the strings of the resx files from the Razor View

<li>@Html.ActionLink("Contact", "Contact", "Home")</li>

Open in new window


I'm triying to call the resx file and retrieve the corresponding string this way:

<li>@Html.ActionLink([namespace.resourcefolder], "Contact", "Home")</li>

Open in new window


but I don't see the App_LocalResources in the Intellisense list after namespace

There is no much specific information about this on the internet
0
Comment
Question by:Miguel Quintana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Assisted Solution

by:Manoj Patil
Manoj Patil earned 500 total points
ID: 41779319
0
 

Assisted Solution

by:Miguel Quintana
Miguel Quintana earned 0 total points
ID: 41784612
Thank you, I have read that article before.

I found this way easier ASP.NET 4 MVC 5 Multi language web-application  however I cannot manage neither calling a custom folder named "Resources" containing  the resx files nor an ASP.NET special folder "App_GlobalResources"

If I create a project from scratch I manage to call the resx files with no issues but then I continue creating other classes and loss all links to these files getting this error: The name 'Resources' does not exist in the current context
0
 

Accepted Solution

by:
Miguel Quintana earned 0 total points
ID: 41784641
Will try this as well and test:

http://www.devcurry.com/2013/02/aspnet-mvc-using-resource-files-to.html

Bringing in Resource Files
Resource files as we all know are xml files with .resx extension and have a dedicated designer to manipulate them in Visual Studio.

Now in the olden days, one would drop resource files in the App_LocalResources folder. However that prevents you from sharing Resources in the Domain layer for example. To avoid this scenario, we add a new Class Library project to our MVC solution and add a new Resource file to it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question