Using shared resources on dotnetnuke module

Dotnetnuke module contains of several user controls. Most often each user control has corresponding local resource file to localize the labels.

But sometimes your might want to create a shared resource files to use from two or more user controls.

When you want to get the localized string from the corresponding resource file.

For e.g: Getting the localized string from edit.ascx from edit.ascx.resx

return  DotNetNuke.Services.Localization.Localization.GetString("ItemTemplate",  this.LocalResourceFile);

When you want to get the localized string from the shared resoruce file(other resource file than the corresponding resource file)

For eg: getting the localized string from edit.ascx from SharedResources.resx

string  sharedResourceFile = DotNetNuke.Common.Globals.ResolveUrl("~/DesktopModules/ModuleName/App_LocalResources/SharedResources.resx");
, , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Share to Facebook Share to Twitter Stumble It Share on Tumblr Digg More...