I have a custom DataSourceControl class that I'm using somewhat like a view model. I'm coming from WPF databinding land and I would like to be able to bind the text of a label to the TotalRowCount using a databinding expression. I can update the label from the code-behind, but that's not very MVVM. This sample generates a label with blank text:
<cc:EquipmentDataSource ID="edsEquipment" runat="server"></cc:EquipmentDataSource>
<asp:Label ID="Label1" runat="server" text='<%# Eval("edsEquipment.TotalRowCount") %>'></asp:Label>
Am I misunderstanding something about how the databinding works? I was getting the same empty string when I used an ObjectDataSource
as well.
Based on this answer, it would appear two things need to change:
Hope that helps!