Multiple User Controls – Single Database Trip?

P

Paul Hale

I have a web form that contains an Ajax TabContianer control with six tabs.
Each tab contains a separate user control. Although each user control
provides a unique UI all user controls require access to the same data. Im
populating all tabs on one trip to the server so users can immediately switch
between tabs without server round trips.

At the moment each user control’s code behind hits the database for the same
data meaning I have six separate database hits.

My question is - Is it possible to hit the database once (perhaps from the
aspx page that implements the user controls) and use the data throughout all
the user controls?

I know I could do away with all the user controls and embed the html
directly under each tab but this would make my page very complex and I like
the way I can segment html and code with separate user controls. I could also
hit the database once and store the results in a session or cache but would
prefer not to as the data will be unique for each user so this is probably
not the most efficient way either.
 
P

Paul Hale

Thanks for responding but thats not really what im after. I know about batch
select statements but my question is can I hit the database once and access
this data via multiple user controls without storing the data in cache or
sessions.

I dont think this is possible but thought I would post to confirm.
 
P

Paul Hale

Actually thinking about it I guess I could hit the db, lookup the controls I
need to bind (that are contained within the seperate user controls) and bind
that way.

Think I have just answered my own question.
 

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
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top