The problem is SelectMethod and other actions execute twice. This has been difficult to isolate, as it only occurs on a larger solution, and not in simpler demo applications.
//.ascx
<asp:FormView runat="server" DataSourceID="userSource" DefaultMode="Edit">
<EditItemTemplate>
<mvp:PageDataSource id="userSource" SelectMethod="GetUser" />
//code behind
public User GetUser()
{
//returning single item as FormView is only DefaultMode=edit
return Model.User;
}
//presenter
public class UserOtherEditPresenter<IUserOtherEditView<UserEditViewModel>>
In an attempt to debug this here is the trace AXD file.
Update:
As it has been pointed out that initialization seems fine, so the problem must lie elsewhere in a conflict with some other aspect of the application.
I had the same problem, the quick fix is to set AutoDataBind = false for your user control. This stops the second call to DataBind of the FormView which in turn stops the second call to the SelectMethod. The first call to formView.DataBind happens as part of Page.ProcessRequestMain and happens due to the DataSourceID on the datagrid.