Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

ExactTarget - What's Your Score
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Localize It! (L...  Localization of user controls inside a user control
Previous Previous
 
Next Next
New Post 2/20/2008 6:28 PM
User is offline JiGong
32 posts
Thatz.com
10th Ranked


Re: Localization of user controls inside a user control 
Chuck, If your resource filename for the control is ImageViewer2.ascx.resx, then you need to rename it to ImageViewer2.ascx.resx to cltImageList.ascx.resx.
 
New Post 2/20/2008 6:50 PM
User is offline William Severance
607 posts
www.wesnetdesigns.com
7th Ranked






Re: Localization of user controls inside a user control 

To Chuck -

Thanks for posting your code as I can now see exactly what you're up against.  See my reply to "JiGong" below for a couple of solutions and the reason for this.

When you initialize the child control's ModuleConfiguration to that of the main control you need to do so not in the Page_Load of the child control but rather in the Page_Load of the main control:

ctlImageList.ModuleConfiguration = Me.ModuleConfiguration


Bill, WESNet Designs
 
New Post 2/20/2008 7:12 PM
User is offline William Severance
607 posts
www.wesnetdesigns.com
7th Ranked






Re: Localization of user controls inside a user control 
Modified By William Severance  on 2/21/2008 7:04:16 AM)

"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.


Bill, WESNet Designs
 
New Post 2/20/2008 8:26 PM
User is offline JiGong
32 posts
Thatz.com
10th Ranked


Re: Localization of user controls inside a user control 

Hi Bill,

Thanks a lot. With the codes, you just solved my next question.

Btw, you got a nice Prayer module. It is based on the Event Module by DNN?

 
New Post 2/21/2008 3:05 AM
User is offline William Severance
607 posts
www.wesnetdesigns.com
7th Ranked






Re: Localization of user controls inside a user control 

Hi JiGong -

The ePrayer module is custom - not based on the DNN Event module.


Bill, WESNet Designs
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Localize It! (L...  Localization of user controls inside a user control
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Willhite & Sharron Realtors
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com
PointClick DotNetNuke Solutions
PointClick Technologies provides high-end DNN Hosting for businesses.
PointClick.Net Hosted Solutions
Active Modules, Inc.
Creators of Active Forums, the best forum module for DotNetNuke
www.activemodules.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP