views:

81

answers:

2

I am trying to set the Text property of a drop down list option like this:

 <asp:ListItem Value="AB" Text='<%= Resources.Get("USA") %>'></asp:ListItem>

But it isn't working, instead the Text value is literally <%= Resources.Get("USA") %> and not the string "USA".

i.e. it is not being interpreted as code.

What is the problem?

+2  A: 

use format <%$ Resources: yourresoucefilename, stringname %>

this should work.

24x7Programmer
A: 

I believe that that syntax only works with sitmap files.

<%= ResourceFileName.ResourceVariableName %>  

should work or Setting the value in the code behind:

ListBox.Items.Add(ResourceFileName.ResourceVariableName);
Arnej65