sharing data between custom controls

A

axis

I have two custom controls on a page that work on the same object that needs
some prepping when first loaded. Currently I just load them in both controls
individually, essentially doing the same work twice.

What's the best way to share data between controls? I know I could place the
data in HttpContext, but would I essentially be tripling the amount of
memory I'm using? 1 copy in control1, 1 copy in context, and 1 copy in
control2. Unless context works by reference. Otherwise, is there a better
way? The controls inherit from a common class already -- is there any way to
have a variable in that parent class that is shared within a page (not
statically
across all instances)?

Thanks
 
A

axis

Won't this mean the object will be serialzed and put on the html as a hidden
form object? (sorry if I'm mistaking view state for something else) It's a
big object, not an int or bool. Also, what implication does this have on
data duplcation?
 
A

axis

BTW -- there's no need to persist the data after the page is rendered. Sorry
I didn't clarify this. It's just data used while rendering the controls. The
data is needed by various controls.
 
R

Robert Koritnik

I would suggest you to check inter webpart communication with sharepoint
services. Actually webparts are nothing lese but web custom controls. I know
comunicating with eachother is possible, but havent checked it out yet.
Check documentation...
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top