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...localizing formview control using .resx fileslocalizing formview control using .resx files
Previous
 
Next
New Post
9/8/2011 4:20 AM
 
hi everybody,
i'm facing some problems in localizing a user control made of asp:formview control.
i used resource file to localize text properties of controls within ItemTemplet, but no text (the localized value) appeared on page.
i'm using DNN 6.

here is my control file CardFields.ascx :

<%@ Control Language="C#" ClassName="CardFields" %>
<asp:FormView ID="FormView1" runat="server">
    <ItemTemplate>
        <table >
            <tr>
                <td>
                    <dnn:Label ID="lbldataTitle" runat="server" resourcekey="lbldataTitle" ControlName="dataTitle" />
                </td>
                 <td>
                    <asp:TextBox runat="server" ID="dataTitle" Text='<%# Bind("Title") %>'  />
                </td>
            </tr>
            <tr>
                <td>
                    <dnn:Label ID="lbldataDescription" runat="server" resourcekey="lbldataDescription" ControlName="dataDescription" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataDescription" Text='<%# Bind("Description") %>'   />
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:FormView>

here is a part of CardFields.ascx.resx file located in a App_LocalResources folder:

<data name="lbldataDescription.Text" xml:space="preserve">
    <value>Description</value>
  </data>
  <data name="lbldataTitle.Text" xml:space="preserve">
    <value>Title</value>
  </data>

i also tried this:
....
<dnn:Label ID="lbldataTitle" runat="server" Text="<%$ Resources:lbldataTitle.Text %>" />
....
but i got this error during build process: " The resource object with key 'lbldataTitle.Text' was not found."

do you see any mistakes in my code?
should i call some dotnetnuke function in the CardFields.cs file (like DotNetNuke.Services.Localization.Localization.LocalizeGridView() in case of GridView)?

please help, and thanks in advance.
 
New Post
9/13/2011 2:16 AM
 
<dnn:label id="lbldataTitle" runat="server" text="&lt;%=Localization.GetString(">" />

This is another way of getting the content from the value from the resource file.

ps: this is a VB code, if using c#, please change it accordingly.

 
New Post
9/15/2011 7:02 AM
 
thank you Ramani for your replay,

my problem is that the formview is not contained in a class that inherits ModuleBase, so i can't use Localization.GetString()..

i created a control [A] contains only [formview1] and i want to use it in another control [B] which contains a custom control [multiformview2] that have many template tags.
i want to use formview1 as <EditItemTemplate> in multiformview2,
the control [B] inherits ModuleBase,

as i could understand, i should use some procedure like "Localization.LocalizeGridView()" in case of GridView.
it seems like the leaf controls of [formview1] (last in deep) cannot be seen in control[B]'s behind code because it is located a template tag.
do i have to implement a custom procedure "Localization.LocalizeMultiFormView()" ? if i have to,.. so how?

thanks in advance
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...localizing formview control using .resx fileslocalizing formview control using .resx files


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