"JiGong" -
You're on the correct track! Because the LocalResourceFile property of PortalModuleBase uses the control's ID property as the base name of the resource file from which localization will be read, you are correct that the resource file would have to be named "ucControlA.ascx.resx" (or in Chuck's case "ctlImageList.ascx.resx"). While this will work nicely, I'm not sure that I would want to name my resource file to that of a specific control ID. Here are three of other solutions (I usually use the first or the third approach).
1. Place all of the localization key-value pairs not in a separate resource file for the child control but rather in the resource file for the main control (Main.ascx.resx) and include the following assignments in the Page_Load handler of the main control:
ucControlA.ModuleConfiguration = Me.ModuleConfiguration 'Not needed for localization but helpful for other purposes
ucControlA.LocalResourceFile = Me.LocalResourceFile 'Use main control's resource file for localizing child control
2. Create the desired ControlA.ascx.resx resource file and set the LocalResourceFile property of the child control to point to this file (in somewhat of a hack) - again in the Page_Load of the main control:
ucControlA.LocalResourceFile = Me.LocalResouceFile.Replace(Me.ID, "ControlA")
3. In your child control, override the LocalResouceFile property as follows:
Public Property LocalResourceFile () As String
Get
If _localResourceFile = String.Empty Then
_localResourceFile = Me.TemplateSourceDirectory & "/" & Services.Localization.Localization.LocalResourceDirectory & "/ControlA"
End If
Return _localResourceFile
End Get
Set (ByVal Value As String)
_localResourceFile = Value
End Set
End Property
NOTE on post EDIT: On thinking about this overnight and verified this morning - You CANNOT overrride the property LocalResourceFile as it is NOT declared overridable in PortalModuleBase. I've written the above property code before in a number of child controls but they did NOT inherit from PortalModuleBase but rather from Framework.UserControlBase which does not have a LocalResourceFile property
Generally if the child control is not reusable outside the module control I use the first solution and use the third solution for reusable child or general purpose user controls controls used in several modules. The second approach is one I just thought up tonight but which has not been extensively tested.