<p>I know there is a similar problem on this forum, but the solutions did not really work for me.  I am populating form controls with fields from a few different data sources, and the data shows up great.</p>

<p>I have an <code>ImageButton</code> control, which has an <code>OnClick</code> Event set to grab all of the data from the form.  Unfortunately, when I click the button, it seems as though the page is reloading first, and THEN is executes the <code>OnClick</code> call.  The data that was hand-entered, or hard-coded seems to be pulled fine from the controls it was entered in, but anything that was pulled from a datasource is not able to be read.  Any ideas.  this is the last hurdle in a project that I have been working on for 6 months.</p>

In EF, if you use this code, you have all the entities that are already loaded in the context (including newly added ones) :
```
```
context.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Modified | EntityState.Unchanged).Select(o => o.Entity).OfType<YourObjectType>()
```
```