How to add localized listitems to a dropdownlist ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Radu

    How to add localized listitems to a dropdownlist ?

    I have a global resource, Scorecards.resx .

    For stuff like
    <asp:CustomVali dator
    id="validDate"
    Text="*"
    ErrorMessage= "<%$ Resources:Score cards, String66 %>"
    Display="Dynami c"
    OnServerValidat e="ServerValida te"
    runat="server">
    </asp:CustomValid ator>
    apparently the syntax
    ....= "<%$ Resources:Score cards, String66 %>"
    works, but in the HTML
    <asp:DropDownLi st ID="cboEPSSessi ons"
    runat="server" ToolTip="<%$ Resources:Score cards, String68 %>"
    > <asp:ListItem>< %$ Resources:Score cards, String103%></
    asp:ListItem> <asp:ListItem>< %$ Resources:Score cards, String104%></
    asp:ListItem> <asp:ListItem>< %$ Resources:Score cards, String105%></
    asp:ListItem>
    </asp:DropDownLis t>
    my syntax doesn't work anymore at all.

    I have the error:
    Literal expressions like '<%$ Resources:Score cards, String103%>' are
    not allowed. Use <asp:Literal runat="server" Text="<%$
    Resources:Score cards, String103%>" /instead.

    But if I use the suggested
    <asp:ListItem>< asp:Literal runat="server" Text="<%$
    Resources:Score cards, String63%>" /></asp:ListItem>
    instead, I get the error
    Element 'Literal' is not a known element. This can occur if there is a
    compilation error in the Web site.

    So then, my question is: How to add localized listitems to a
    dropdownlist ?
Working...