Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now