473,803 Members | 3,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jun 27 '08 #1
1 6763
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
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10602
by: charliewest | last post by:
I have binded a dropdownlist control to a data view. I am trying to add a listitem to this already binded control, however, i cannot figure this out. My code is: // code to create data view object (dv) DropDownList1.DataSource = dv; DropDownList1.DataMember = "vStA"; DropDownList1.DataTextField = "vStAText"; DropDownList1.DataValueField = "vStAId";
7
8575
by: Doug | last post by:
I want to display a drop-down list (System.Web.UI.WebControls.DropDownList) loaded with font names the user can select (Verdana, Garamond, etc)... got this far no problem. Now I'd like to have the list show ListItem styled with the font being listed (ie., the "Verdana" ListItem is styled as Verdana). Here's my code that doesn't work. Note fontFaces is a string array that lists the fonts being loaded into the DDL).
1
2603
by: Jeff | last post by:
Hi - I'm creating a web control library (using VB.NET), and I'm trying to add a modified asp:dropdownlist control to it. How do I add asp:ListItems to the dropdownlist (within the web control library control)? My code follows below (and it doesn't work). When I add the control to an aspx page, I simply get a string of the concatenated values ("First
1
3562
by: HoustonFreeways | last post by:
I am populating a dropdownlist via a databind to a database. However, the text to be displayed can be very long, making the dropdownlist very wide. I need some way to reduce the width of the dropdownlist but still show the entire text of the listitem option. Observations: 1. Setting the dropdownlist to a fixed width chops off the option text to the width of the control (making long text invisible). 2. Listitem elements are plain text...
3
2368
by: Mark Findlay | last post by:
When programming reads of the Windows Registry, do the registry keys and values need to be localized for international use? For example, do I need to convert the key name L"\\Software\\Microsoft\\Windows" into Japanese, Korean, etc., for use in those markets? Thanks experts!
2
1815
by: Arthur Dent | last post by:
Hi all, I have a control which i wrote which inherits the asp:dropdownlist control. Works great, all happy. If when using it i try to declaratively add some items, it complains that they are unknown types. eg... <mytag:mydropdownlist id="lstInherited" runat="server" appenddatabounditems="true" > <asp:listitem id="" value="select an item" >
8
7787
by: sudhaMurugesan | last post by:
Hi, Can anyone Help. I have two dropdownlist for qualification and degree. According to the qualification(eg.Diploma,UG,PG) degree gets binded in the dropdownlist. I have done this in javascript.It works fine but the values binded early does not get cleared. How to remove previously binded items and rebind with new Items.If any corrections i Have to do then please tell me.Urgent. I await for reply. My code is // Items is an array like ...
25
2129
by: sudhaMurugesan | last post by:
Hi ALL, I am binding ListItems to dropdownlist using js.But the selected value is not retained while save operation. Do I need to capture the selected Item in any hiddenfields ? plz tell me Sudha
0
233
by: Radu | last post by:
I have a global resource, Scorecards.resx. For stuff like <asp:CustomValidator id="validDate" Text="*" ErrorMessage= "<%$ Resources:Scorecards, String66 %>" Display="Dynamic" OnServerValidate="ServerValidate" runat="server">
1
1644
by: Nathan Sokalski | last post by:
I am creating a control in which I inherit from the DropDownList. The only method that I override is RenderContents. Here is my basic code: Public Class StatesDropDownList : Inherits DropDownList Protected Overrides Sub RenderContents(ByVal writer As System.Web.UI.HtmlTextWriter) 'I add several items to the Items property here using Me.Items.Add() MyBase.RenderContents(writer) End Sub
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4274
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.