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 ?

    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 ?

    Thank you.
    Alex
  • Radu

    #2
    Re: How to add localized listitems to a dropdownlist ?

    As another user said in some thread, the best way to solve a problem
    is to post the question here - you don't event need to have it
    answered - the moment you hit the "post" button, you realize how
    simple the answer was, and how blind you have been.

    In other words, it's as simple as:
    <asp:ListItem Text="<%$ Resources:Score cards, String103%>"></
    asp:ListItem>

    or

    <option selected="selec ted" value="<%$ Resources:Score cards,
    String79%>"></option>

    instead of

    <asp:ListItem>< %$ Resources:Score cards, String103%></asp:ListItem>

    or

    <option selected="selec ted"><%$ Resources:Score cards, String79%></
    option>

    I am sorry for not having an option to withdraw a question.

    Thanks again.

    On Apr 24, 4:37 pm, Radu <cuca_macaii2.. .@yahoo.comwrot e:
    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 ?
    >
    Thank you.
    Alex

    Comment

    Working...