Link to home
Start Free TrialLog in
Avatar of kalliopi
kalliopi

asked on

DataSourceID and MasterPages...

I have a strange issue that makes sense, but was very unexpected.

I have a master page with 2 content areas.  I've got an ObjectDataSource1 object in the 1st of those content areas.  I've also got databound controls in both areas that point at that single datasource.  The problem is that when i run the app, any controls in the 2nd Content area gives me the following error:

The DataSourceID of 'FormView2' must be the ID of a control of type IDataSource.  A control with ID 'ObjectDataSource1' could not be found.

FormView2 is the control in the 2nd content area.  If I move the DataSource over to the 2nd content area, the error changes to:

The DataSourceID of 'FormView1' must be the ID of a control of type IDataSource.  A control with ID 'ObjectDataSource1' could not be found.

It's like it can't see the datasource if it's not in the same "Content Area".  I understand WHY this might be, but how am I expected to make this work?  Do I really have to load all the data twice if I want to display it in two content areas?

Thoughts?
Avatar of craskin
craskin
Flag of United States of America image

i don't know the exact answer to your question, but it sounds to me like a dataset would work better for you.
Avatar of kalliopi
kalliopi

ASKER

I can't find a dataset control in the toolbox for 2005?
it's not a control. what i meant was you might be better off filling a dataset using a dataadapter. that way, you can programatically databind any controls in the code-behind.
I know that I can do this in code - I'm trying to take advantage of the UI - which is obviously a VERY powerful feature.  What's strange is that it seems to "break" as soon as the controls are in different Content Areas...

Any suggestions about how one is meant to "get around" this limitation?
ASKER CERTIFIED SOLUTION
Avatar of mppeters
mppeters

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I haven't tried it yet - but this looks like EXACTLY what I'm looking for.  I will assume that it will work, and I'll be all set.

Thanks-a-mil!

EJ