Set ListItem value to constant for RadioButtonList in ASPX

I must be doing something wrong here but I can't find an easy way to get this to work.

Imagine the following code:

<asp:RadioButtonList ID="MyRadioButtonList" runat="server">
    <asp:ListItem Value="<%= CompanyName.SystemName.Constants.PaymentFrequency.FREQUENT.ToString() %>" Text="Yes" Selected="True"></asp:ListItem>
    <asp:ListItem Value="<%= CompanyName.SystemName.Constants.PaymentFrequency.ONCE.ToString() %>" Text="No, Just do this once"></asp:ListItem>
</asp:RadioButtonList>

But it doesn't compile the statement before it renders the page. So if I get the selected value of this radiobuttonlist it contains something like "<%= Compan... %>" instead of what my constant defines.

What is the correct syntax for this?

6
задан Peter 23 September 2010 в 11:56
поделиться