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.
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.