I have a DataList control which is bound by SQLDataSource. The data source is fetching two column values, viz: ID, Name.
The DataList ItemTemplate looks like this:
<DataList>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval(Name) %>' />
</ItemTemplate>
</DataList>
I want the Label ID to be bound to the first column like:
<asp:Label ID='<%# Eval(ID) %> ...../>
But it gives error that ID should be simple.
Is there any way to use Eval value to generate assign to Label ID?
You can’t assign it using data binding but you can access the ClientID and use that else were.