Hello, people!
I'm just about to finish a project, but I am stuck at something that, hopefully, is somthing silly I am missing...
I have a DetailsView attached to an ObjectDataSource (the DataSource was created with NetTiers, if this is relevant information). I can't make it work as desired if the DataSource returns only one record, but nothing wrong happens with two or more. In the particular case in which i have only one record and try to call any functionality, I receive the error message "Databind methods such as Bind(), Eval() and XPath() are only allowed in the context of a DataBound Control" (I can't remember if these are the actual words, but that's the spirit).
This is how the Filter is used inside the DetailsView:
<asp:TemplateField HeaderText="AddressType">
<ItemTemplate>
<asp:Repeater runat="server" ID="rptAddressType"
DataSourceID="AddressTypeFilter">
<ItemTemplate>
<%# Eval("TypeName") %>
</ItemTemplate>
</asp:Repeater>
<data:EntityDataSourceFilter runat="server"
ID="AddressTypeFilter"
DataSourceID="AddressTypeDataSource"
EnableViewState="true"
Filter='<%# String.Format("AddressTypeSeq = {0}", Eval("AddressTypeSeq")) %>'
/>
<data:AddressTypeDataSource runat="server"
ID="AddressTypeDataSource" SelectMethod="GetAll">
</data:AddressTypeDataSource>
</ItemTemplate>
</asp:TemplateField>
As I said before - the strange thing is that it works sometimes, others it doesn't, and I still couldn't figure out why... Can anyone help me?
Thank you,
Thiago.