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...Is Localiztion codes on ASP.NET Compatible to DNN?Is Localiztion codes on ASP.NET Compatible to DNN?
Previous
 
Next
New Post
7/29/2008 2:23 AM
 

For example, does the following syntax still work on DNN?

<asp:Label ID="lblRows" runat="server" Text="<%$ Resources:lblRows.Text %>" ></asp:Label>

More importantly, does the above will reach appropriate resource file in App_LocalResources according to the selected lanague via DNN?

Thanks a lot.

Ricky.

 
New Post
7/29/2008 10:45 AM
 

aliasncnu,

You'll want to use the following syntax:

<asp:Label runat="server" ResourceKey="RowsLabel" />

If you are in a control called "Text.ascx" - this will look in (relatively) App_LocalResources\Text.ascx.resx" for a key "RowsLabel.Text" and return the appropriate value.

This (behind the scenes) uses the LocalResourceFile property from portal module base to dynamically create the appropriate relative URL for a given control.

That should be a good start - let us know if you have any other questions.

Take care,

Ian

 


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
7/29/2008 8:36 PM
 

Ian Robinson wrote

aliasncnu,

You'll want to use the following syntax:

If you are in a control called "Text.ascx" - this will look in (relatively) App_LocalResources\Text.ascx.resx" for a key "RowsLabel.Text" and return the appropriate value.

This (behind the scenes) uses the LocalResourceFile property from portal module base to dynamically create the appropriate relative URL for a given control.

Hello Lan,

Appreciate much for your reply.

Actually, I have had a UserControl, UC that is localized with ASP.NET bulit-in manner (as in original post), and would like to transfer it to DNN. Is there any knack that is compatibile to both ASP.NET and DNN localization mechanism?

Thanks,

Ricky.

 
New Post
7/29/2008 11:45 PM
Accepted Answer 

Hi Ian,

I ran into a similar issue awhile back, and was forced to adapt DNN to allow use of ASP.NET localization (DNN had its own powerful localization library long before ASP.NET 2.0).  I discuss the changes necessary to utilize both methods side-by-side here: http://brandonhaynes.org/GamePlan3/Home/tabid/489/EntryID/4/Default.aspx.  Unfortunately, at this time it still requires one small core change (and the resultant recompile).  I believe the work item that would alleviate this core change is still open, so there remains some small hope that in the future this method would be possible without any core modifications.

Hope this helps!

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
8/16/2008 4:46 PM
 

First of all, aliasncnu sorry for the hijack of your post but I wasn't able to find an email for Brandon and figured this would be a great edition to this post.

Brandon - great post!  Got a few questions:  I am building custom controls (.ascx files) within my own ASP.NET 3.5 web project, compiling the project, adding the .dlls to the BIN directory and adding the ascx control to my DNN site via Xepient Solutions Open-Smart Module and all is well!  The problem is I am not able to localize any of the text although I have an App_LocalResources directory in my local project and the needed resourceKey:Label1.Text.  Is there something else I have to do in order to get this to work properly?  My controls are in the Portals\0 directory of my DNN site and I have tried to put my App_LocalResources directory in there as well as other places and still nothing.  Any suggestions?


View Brenden Kehren's profile on LinkedIn
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...Is Localiztion codes on ASP.NET Compatible to DNN?Is Localiztion codes on ASP.NET Compatible to DNN?


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