Referring to Data Source Controls across Content Controls

B

Bill Nicholson

A page has 2 Content Controls. One Object Data Source is in one of
those Content Controls. There are Data Controls in both Content
Controls that can use the Object Data Source. At design time, VS 2005
will let you assign the Object Data Source to both of the Data
Controls. However, at runtime, the app Yellow Screens because the
Object Data Source cannot be resolved unless it's in the same Content
Control as the Data Control.

"The DataSourceID of 'GridViewSample' must be the ID of a control of
type IDataSource. A control with ID 'ObjectDataSourceSample' could
not be found."


Also, you can't have a Object Data Source control with the same name
in two different Content Controls. VS 2005 prevents that.

Therefore you end up with the exact same identical Object Data Source
in two places in the aspx code, each with a different name. A
maintenance nightmare.

Am I missing something? Is there a better way to do this?

Thanks,

Bill
Cincinnati, OH USA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top