I'm trying to use a FormView control (ASP.NET 4.0) to display/edit an Entity from an EF 4.0 query.
I can successfully set my entity as the DataSource of the FormView control, and it displays properly.
The problem is that as soon as I have any postback on the page, the FormView reverts to the Empty Data message templates contents. When I look at the state of the control via the debugger, I see that it still says it has a DataItemCount of 1 and has the correct data key value. It simply decides to show the empty data message instead of showing my item template.
Aside from using a single entity (as apposed to a collection of entities) as my data source, the only other funky thing I'm doing is that the FormView lives inside an ajax panel. (And so does the control causing the postback.)
View Complete Post