Hi,
I am trying to use a SharedResource (for module wide error messages) within a custom module and I can't get it to work. I have read through the Localization document (pdf). This is the code I am using: (I did create the file SharedResources.resx in the folder /DesktopModules/MyModule/AdminModules/App_LocalResources/ )
Private SharedResourceFile As String = ApplicationPath + "/DesktopModules/MyModule/AdminModules/App_LocalResources/SharedResources"
lblErrorMessage.Text = Localization.GetString("ErrorKey", SharedResourceFile)
I have tried both: "/DesktopModules/MyModule/AdminModules/App_LocalResources/SharedResources" and
"/DesktopModules/MyModule/AdminModules/App_LocalResources/SharedResources.resx" but neither works.
It works if I put the key in the resource file for the control (MyControl.ascx.resx) and use:
lblErrorMessage.Text = Localization.GetString("ErrorKey", LocalResourceFile)
I put a breakpoint in the code to check the value of SharedResourceFile and LocalResourceFile and they look the same (except for the name of the resource file, SharedResources vs. MyControl.)
Any thoughts?
Thanks,
Robert