1 DataSource to Man DataBound Controls

J

jazzMan007

Hey All -

I'm working on a web application that is the UI front end to our
product. On one particular screen, the user is viewing a single result,
but only some parts are visible. I've created a datasource control that
fetches the data from the server, and databound controls that use that
data source. On the page there could be any number of data bound
controls bound to one data source. For the data source to know what
data to fetch, it has a 'Selecting' event that is wired into by each
control. In the handler of that event, it sets its request into the
Selecting event args and returns them.

I've gotten this setup working pretty well. It only selects when the
data changes (ie. the user navigates records) and not on postbacks, and
when the datasourceview performs the select, all the controls are
hooked in properly to submit their request for data fetching.

The problem I'm running into is that the datasource is selecting once
for every control on the page! Each individual select ends up running
the same request since the hooks into the controls for their requests
work fine...it just happens many times!

Is this intended behaviour of the DataSource/DataBound controls? If I
use a SqlDataSource, and have, say, a gridview and detailview going to
the same datasource, is it going to select twice?

Any ideas?

Thanks in advance,
John
 

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

Forum statistics

Threads
474,001
Messages
2,570,251
Members
46,850
Latest member
Brightrs

Latest Threads

Top