Solved

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

Posted on 2016-08-31
4
130 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

Technology Partners: 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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

623 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