Lifewithsun
Lifewithsun

Reputation: 998

Use Resource file variable in MVC view

I have created resx file in Content Folder where this is available for model but when I tried to access it from view it doesn't show up.

Folder structure like below:

enter image description here

Where I am trying to access the data like this:

  <p>@Resources.Resources.lblHomeDesc1</p> 

But it doesn't render the data and settings are CustomTool=PublicResXFileCodeGenerator, BuildAction=Embedded Resource. How to use resx file data in MVC view? Does we need to add reference in web.config? Is there something else I am missing to add?

Upvotes: 0

Views: 685

Answers (1)

Lifewithsun
Lifewithsun

Reputation: 998

I have achieved the by creating new folder for Resource files folder structure below : enter image description here

and updated Custom Tool Namespace = Resources.

Upvotes: 0

Related Questions