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  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Localize It! (L...  localizing ListItem, CheckBoxList, ETC
Previous Previous
 
Next Next
New Post 1/11/2008 5:57 AM
User is offline Josh Squires
9 posts
Structured-Systems.net
10th Ranked


localizing ListItem, CheckBoxList, ETC 

Hey everyone new to DNN and I'm attempting to convert some of my controls to DNN.

I read through all the documentation and I can't seem to find why my ListBox and CheckBoxList ListItem's are not localizing correctly in DNN4. The DropDownList and RadioButtonList localize correctly but not the ListBox and CheckBoxList.

I can't find anything in the forums through searching and nothing directly references to it in any of the documentation. Alas even my google search yeild no findings so it must be something easy that I am just doing incorrectly.

<asp:ListBox ID="ListBox1" runat="server" Rows="1">
<asp:ListItem resourcekey="TestResults" Value="1">Text</asp:ListItem> (Doesn't Work)
</asp:ListBox>


<asp:DropDownList ID="DropDownList1" runat="server">
 <asp:ListItem resourcekey="TestResults" Value="1">Text</asp:ListItem> (Works)
</asp:DropDownList>

 <data name="TestResults.Text">
  <value>Localized Text</value>
 </data>

Any help and direction would be appreciated

-Josh

 

 
New Post 1/11/2008 7:03 AM
User is offline digmike
185 posts
www.dignuke.com
9th Ranked


Re: localizing ListItem, CheckBoxList, ETC 

Hi Josh,

Oddly enough, there is no DNN routine to do this.  Here is code I use:

public void LocalizeCheckListBox( CheckBoxList ctl, string resourceFile )
{
    foreach (ListItem item in ctl.Items)
    {
        string key = item.Attributes["resourcekey"];
        if (key != null)
        {
            item.Text = Localization.GetString(key, resourceFile);
        }
    }
}


dignuke.com
 
New Post 1/11/2008 7:16 AM
Online now... William Severance
787 posts
www.wesnetdesigns.com
7th Ranked






Re: localizing ListItem, CheckBoxList, ETC 

It appears that the ProcessControl method of the DotNetNuke.Framework.PageBase which is where localization of controls on the page occurs specifically targets DropDownList and RadioButtonList as it iterates through their collection of ListItem objects but does not provide similar processing for other types of list controls such as ListBox and CheckBoxList.  The ProcessControl method also tries to localize any child controls, but since the ListItem class derives from System.Object rather than from System.Web.UI.WebControls.WebControl, this fails also.

I did not follow the code through completely and may be missing something, but based on a quick look suggest that you add this to Gemini as either a bug or feature request. In the meantime, you would have to provide your own localization by iterating through each ListItem of your ListBox or CheckBoxList and using the DotNetNuke.Services.Localization.Localization.GetString method to obtain the localized strings. When I've used ListBox and CheckBoxList controls, I've always pulled the values from the database so had not run into this problem before.


Bill, WESNet Designs
 
New Post 1/13/2008 3:32 AM
User is offline Josh Squires
9 posts
Structured-Systems.net
10th Ranked


Re: localizing ListItem, CheckBoxList, ETC 

Thanks for the information guys. I will have to find another way to do my checkboxlists as I have far too may to us your suggestion digMike. The control that I am attempting to convert has over 100 CheckBoxLists spanning 6 different panels some hidden and some not based on the viewers progress.

I really appreciate you guy responding so quickly I didn't expect I would get an answer this quickly. Thanks Again

-Josh

 
New Post 1/13/2008 4:21 AM
User is offline Sebastian Leupold
14228 posts
www.deutschnetnuke.de
1st Ranked












Re: localizing ListItem, CheckBoxList, ETC 

please log this as enhancement request into the public issue tracker at support.dotnetnuke.com. Thank you.


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Localize It! (L...  localizing ListItem, CheckBoxList, ETC
 


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.

 


Multipartner Virtual Data Rooms
The Virtual Data Rooms (VDR) provided by an expert advisor, far from any ordinary software company!, supporting the sellers and their consultants. Multipartner builds and services higly professional Virtual Data Rooms (VDR) specifically tailored to M&A, Real Estate and NPL deals.
www.multipartner.com
DNN SEO
Seablick Consulting specializes in DNN search engine optimization (SEO), DNN consulting, as well as support & training.
seablick.com
Intura Vision / Intura Enterprise
Point-of-Sale and business management applications targeted towards quick service, fast casual and delivery-based restaurant concepts.
www.intura.com

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