By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,958 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,958 IT Pros & Developers. It's quick & easy.

How to add localized listitems to a dropdownlist ?

P: n/a
For stuff like
<asp:CustomValidator
id="validDate"
Text="*"
ErrorMessage= "<%$ Resources:Scorecards, String66 %>"
Display="Dynamic"
OnServerValidate="ServerValidate"
runat="server">
</asp:CustomValidator>
apparently the syntax
....= "<%$ Resources:Scorecards, String66 %>"
works, but in the HTML
<asp:DropDownList
ID="cboEPSSessions"

runat="server"
ToolTip="<%$ Resources:Scorecards, String68 %>"
>
<asp:ListItem><%$ Resources:Scorecards, String103%></
asp:ListItem>
<asp:ListItem><%$ Resources:Scorecards, String104%></
asp:ListItem>
<asp:ListItem><%$ Resources:Scorecards, String105%></
asp:ListItem>
</asp:DropDownList>
my syntax doesn't work anymore at all.

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

But if I use the suggested
<asp:ListItem>
<asp:Literal runat="server" Text="<%$ Resources:Scorecards,
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
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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:Scorecards, String103%>"></
asp:ListItem>

or

<option selected="selected" value="<%$ Resources:Scorecards,
String79%>"></option>

instead of

<asp:ListItem><%$ Resources:Scorecards, String103%></asp:ListItem>

or

<option selected="selected"><%$ Resources:Scorecards, 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.comwrote:
For stuff like
<asp:CustomValidator
* * * * id="validDate"
* * * * Text="*"
* * * * ErrorMessage= "<%$ Resources:Scorecards, String66 %>"
* * * * Display="Dynamic"
* * * * OnServerValidate="ServerValidate"
* * * * runat="server">
</asp:CustomValidator>
apparently the syntax
...= "<%$ Resources:Scorecards, String66 %>"
works, but in the HTML
<asp:DropDownList
* * * * ID="cboEPSSessions"

runat="server"
* * * * ToolTip="<%$ Resources:Scorecards, String68 %>"
* * * * >
* * * * <asp:ListItem><%$ Resources:Scorecards, String103%></
asp:ListItem>
* * * * <asp:ListItem><%$ Resources:Scorecards, String104%></
asp:ListItem>
* * * * <asp:ListItem><%$ Resources:Scorecards, String105%></
asp:ListItem>
</asp:DropDownList>
my syntax doesn't work anymore at all.

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

But if I use the suggested
<asp:ListItem>
* * * * <asp:Literal runat="server" Text="<%$ Resources:Scorecards,
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
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.