Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...Static localization for module componentsStatic localization for module components
Previous
 
Next
New Post
2/16/2011 6:28 AM
 
I have a module that, in addition to user controls that inherit from the DNN module base classes, makes use of a number of .ascx components that inherit directly from System.Web.UI.UserControl.

I am trying to get a custom validator control to pick up its ErrorMessage string from a resource file. I have tried using both DNN and ASP.NET style localization but with no success.

Can anyone tell me if in this scenario, should I be using ASP.NET or DNN localization, and what I do I need to do to get it to work?


Paul Taylor
Dotcom Software Solutions Ltd
DotNetNuke, ASP.NET and SQL Server Development
 
New Post
2/18/2011 3:51 PM
 
dotnetnuke explicitly disables asp.net localization (in web.config you'll see resx and resources being removed in the buildproviders section) so the best approach is to use the dotnetnuke API to do this e.g. use GetString to set the errormessage via code-behind.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
3/11/2011 5:51 AM
 
Thanks Cathal. Interestingly, I discovered that if you add a property called LocalResourceFile to your user control (or ideally to a base class), which returns the path to its resource file, the framework localises its controls just as if it were a DNN control. I used the following code:


        Public ReadOnly Property LocalResourceFile As String
            Get
                Dim path As String = ResolveUrl(AppRelativeVirtualPath)
                Dim idx As Int32 = path.LastIndexOf("/")
                path = String.Format("{0}/App_LocalResources{1}", path.Substring(0, idx), path.Substring(idx).Replace(".ascx", String.Empty))
                Return path
            End Get
        End Property


Paul Taylor
Dotcom Software Solutions Ltd
DotNetNuke, ASP.NET and SQL Server Development
 
New Post
3/12/2011 11:35 AM
 
Hi Cathal

Why does DNN disable asp.net localization? Can I re-enable it for my custom modules to use? Or, can I get whatever DNN uses for localization to use a database instead of .resx files?

Neil
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...Static localization for module componentsStatic localization for module components


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out