A
Abhishek Srivastava
Hello All,
I have bound an ArrayList to a repeater control. When the list is
displayed, I want the the user to be able to choose one of the items in
the list and then continue working. To achieve this I have done the
following
<asp:Repeater id='rep1' runat='server'>
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:RadioButton Text='' Runat='server' Group='mygrp'
ID='<%# DataBinder.Eval(Container.DataItem, "Id")%>' />
</td>
<td>
<%#DataBinder.Eval(Container.DataItem, "Name")%>>
</td>
<tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
But I get an error that <%#DataBinder.Eval(Container.DataItem, "ID")%>
is not a valid identifier.
Why can't I assign the ID dynamically?
Thanks for your help in advance.
regards,
Abhishek.
I have bound an ArrayList to a repeater control. When the list is
displayed, I want the the user to be able to choose one of the items in
the list and then continue working. To achieve this I have done the
following
<asp:Repeater id='rep1' runat='server'>
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:RadioButton Text='' Runat='server' Group='mygrp'
ID='<%# DataBinder.Eval(Container.DataItem, "Id")%>' />
</td>
<td>
<%#DataBinder.Eval(Container.DataItem, "Name")%>>
</td>
<tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
But I get an error that <%#DataBinder.Eval(Container.DataItem, "ID")%>
is not a valid identifier.
Why can't I assign the ID dynamically?
Thanks for your help in advance.
regards,
Abhishek.