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...Localization of user controls inside a user controlLocalization of user controls inside a user control
Previous
 
Next
New Post
2/21/2008 6:54 PM
 

Bill & JiGong,

Base on the information exchange between both of you I have solved my problem and learned a few things in the process.  That's one of the things I like most about the DNN Community -- everyone's willing to share info & experiences.

Bill,,, For the record, I chose your option #2 setting the child control's LocalResourceFile in the Page_Load of the main form.  I have made note of your comment about that option not having been tested much and will note any problems but so far it seems to work fine.  At least for my current need.  In case your wondering, I chose to go with naming the resource file using the filename of the user control itself.  It seems to be less confusing, this way all the resource files match the actual user controls that uses them.

Again, many thanks to both.  Best Regards,

Chuck R.

 
New Post
7/26/2010 6:36 PM
 
The parent control doesn't know that the child control inherits from PortalModuleBase until runtime, so I had to do this:
((PortalModuleBase)(UserControl)ucControlA).LocalResourceFile = this.LocalResourceFile;
 
New Post
4/2/2012 11:27 AM
 
This just a slight variation of what Mr. William Severance wrote, but I am able to stick with the directory structure and naming convention of ~/controls/App_LocalResources/ControlA.ascx.resx. It seems to work OK, so far...

I have only added this to the child user control and do nothing with events:

Private _localResourceFile As String

    Public ReadOnly Property LocalResourceFile() As String
        Get
            If _localResourceFile = String.Empty Then
                _localResourceFile = Me.TemplateSourceDirectory & "/" & Services.Localization.Localization.LocalResourceDirectory & "/" & Path.GetFileName(Me.AppRelativeVirtualPath)
            End If
            Return _localResourceFile
        End Get
    End Property
 
New Post
7/4/2012 5:04 AM
 
Hi

It seems that your component is quite complex that should be broken to several user controls. It is recommended to make the Main.ascx.cs inherit from PortModuleBase and other child user control normal asp.net controls.
Actually, you can develop your complex business logic in normal asp.net project manner. Please refer to
http://think2next.blogspot.com/2012/07/before-writing-article-i-have-thought.html

I think it would work for you and it has been implemented and deployed in one of my projects.
 
New Post
9/11/2018 8:11 PM
 

Hi

I have the same problem and have read through this thread and tried everything to no avail. I am using DNN 8.0.4.

My skin user control pulls in localisation text fine. This skin control displays two common child user controls which are used in several skin files. I am trying to add localisation to one of these child user controls.

The span placeholder tag is loading into the child control when browsing but the child control is not pulling in the localisation text from its resource file which is located in the App_LocalResources sub-folder.

Stripped down a little my main skin code is:

<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" CodeBehind="Blar.ascx.vb" %>

<%@ Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>

<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.DDRMenu.TemplateEngine" Assembly="DotNetNuke.Web.DDRMenu" %>

<%@ Register TagPrefix="dnn" TagName="MENU" src="~/DesktopModules/DDRMenu/Menu.ascx" %>

<%@ Register TagPrefix="dnn" TagName="TEXT" Src="~/Admin/Skins/Text.ascx" %>

<%@ Register src="~/Portals/0/Skins/MySkin/ctrlContactUs.ascx" tagname="ctrlContactUs" tagprefix="cu1" %>

 

Child Control:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ctrlContactUs.ascx.vb" Inherits="Portals_0_Skins_MySkin_ctrlContactUs" %>

<%@ Register TagPrefix="uc" TagName="CONTACTUS" Src="~/Admin/Skins/Text.ascx" %>

 

Child Resource in  sub-folder App_LocalResources:

 

    Blar blar.

 

 

    +44 (0)1234 567890

 

 

 

 

I've been round in circles for a whole day on this but cannot get it to work. any help would be most appreciated.

Thanks in advance.

 

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...Localization of user controls inside a user controlLocalization of user controls inside a user control


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