Register   Login
     
  Categories  
  Archive  
  Authors  
21
Sometimes you need to retrieve values from a resource file that is centrally located  to your module. This is commonly known as a shared resource.
 
I think for version 3.0.13, there is a bug in the core that does not allow you to extract values out of a shared resource file using Localization.SharedResourceFile, this is actually a constant so it will never point to the correct file.
 
I use the following method within my modules to extract values from a shared resource file. It will map a map path to the required resource file in your local resource directory.

PrivateSub AssignLocalization()

Dim path AsString = Me.TemplateSourceDirectory & "/" & Localization.LocalResourceDirectory & "/" & Localization.LocalSharedResourceFile

path = "~" & path.Substring(path.IndexOf("/DesktopModules/"), path.Length - path.IndexOf("/DesktopModules/"))

lnkCurrentNews.Text = Localization.GetString("CurrentArticles.Text", path)

EndSub
 
Have you found a better way?
Posted in: DotNetNuke

Post Rating

Comments

Super User Account
# Super User Account
Tuesday, March 18, 2008 7:27 AM
Test
Scott McCulloch
Tuesday, March 18, 2008 7:29 AM
Howdy!

Post Comment

Name (required)

Email (required)

Website

Enter the code shown above: