Solved

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

Posted on 2016-08-31
4
17 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
Comment Utility
0
 

Assisted Solution

by:Miguel Quintana
Miguel Quintana earned 0 total points
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP.net VB.net Email  a webpage 3 24
c# regex: extract & replace text between braces 6 26
Hidden Field Value 10 33
XML & .net 5 0
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

8 Experts available now in Live!

Get 1:1 Help Now