I have this error when I try to update a FormView
Could not find a property named 'MainContact.FirstName' on the type specified by the DataObjectTypeName property in ObjectDataSource 'odsForm'.
I think it is because I use in the EditTemplate a Textbox like this
<asp:TextBox Text='<%# Bind("MainContact.FirstName") %>' ID="txtFirstName" runat="server" />
It shows the right text in the Textbox, but apparently it doesn't work when it updates.
This is the datasource of the FormView
<asp:ObjectDataSource ID="odsForm" runat="server" DataObjectTypeName="Helpers.BusinessObjects.EntryItem"
SelectMethod="GetEntryByEmail" TypeName="Helpers.DataAccessers.EntryHelper"
UpdateMethod="UpdateEntry">
<SelectParameters>
<asp:SessionParameter SessionField="email" Name="email" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
This is the EntryItem Class
public class EntryItem
{
public int Id { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public Person MainContact { get; set; }
...
}
And the Person Class
public class Person
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
...
}
The debugger gets in the FormView ItemUpdating
event handler, but never in Helpers.DataAccessers.EntryHelper.UpdateEntry
.
How can I solve this?