0

I have a multi project solution for an asp.net website. There is DAL, BLL and entity projects all shared with another application and a resources project for strings (to support multiple languages).

The resource is set to public. Common.Resources is the both the project name and the namespace. Strings is the Resource file. Accessing the resources in code after referencing the project is easy

Common.Resources.Strings.[MyResourceStringNameHere]

The issue is I need to access the resource strings in the sitemap and in literal html tags doesn't work. Examples of what i have tried below.

$Resources:Strings, [MyResourceStringNameHere]
$Resources:Common.Resources.Strings, [MyResourceStringNameHere]

Much searching has led me to believe that I may need a resource manager to bring in the resources from the other project. All examples are aimed towards a SQL resource manager so aren't proving particularly helpful. Any examples, suggestions, etc would be gratefully received.

Thanks in advance...

Gsk
  • 2,929
  • 5
  • 22
  • 29
HendJ
  • 5
  • 3

1 Answers1

-1

Here's nice example of sitemap globalization for ASP.NET Core using external resources: Globalization in MVCSiteMapProvider

If project does not use ASP .NET Core, you can follow instructions in: https://msdn.microsoft.com/en-us/library/aa905797.aspx#exaspnet20rpm_topic5

Basically, you need to create custom ResourceProviderFactory which should return yours implementation of IResourceProvider where you can handle external resources.

Gecko
  • 16
  • 1
  • Great thank you. I will work though the example. Unfortunately the links to source code are missing but I should be able to work it through. – HendJ Jun 04 '18 at 09:47
  • You can check out this repository for example implementation: https://github.com/DynamicTyped/Bocce/tree/master/Bocce – Gecko Jun 04 '18 at 16:55