A question about <asp:ListItem>

C

CGuy

Hi,

I have a RadioButtonList control in my aspx page which shows two
radiobuttons - "Yes" and "No". Since my page is intended for international
audience, I would like the texts "Yes" and "No" to be read from resource
files. Right now, I'm doing it by the following code


ListItem[] items = new ListItem[]{new
ListItem(resourceManager.GetString("YES"), "Yes"), new
ListItem(resourceManager.GetString("NO"), "No")};
this.radioButtonList.Items.AddRange(items);

But, I would like to do this using the ASP.NET explicit syntax - something
like this

<asp:radiobuttonlist runat="server">
<asp:listitem value="yes" selected="true"><% =
resourceManager.GetString("YES") %></asp:listitem>
<asp:listitem value="no"><% = resourceManager.GetString("NO")
%></asp:listitem>
</asp:radiobuttonlist>

How do I accomplish this?

CGuy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top