User Controls: can they communicate?

  • Thread starter Thread starter Douglas Macnguyen
  • Start date Start date
D

Douglas Macnguyen

I have multiple user controls (.ascx) on a page (.aspx). How can a user
control interact with each other? Also, how can a user control interact with
the page?

TIA,
Douglas
 
They cannot automatically communicate with each other. The host is their
protocol. Use the form they are on to send messagaging and trap events btw
various controls. I communicate w/ my controls by way of events. Define an
event in the control w/ the needed event arguments. On the host page
subscribe to the event after initializing the control. When the ctrl needs
to send something ("communicate") w/ the host form it sends the event
notification. Standard User32 stuff.

Hope this helps.

Nick Harris, MCSD
http://www.VizSoft.net
 
Through the use of properties, methods, and events.

If the main page needs to respond to some action from the usercontrol, that
control should expose some events that the main page can subscribe to.

If you want usercontrols to communicate with each other, then again, setup a
series of event notifications and subscribe as needed.
 
Hi Douglas,

Do you still have any concern?
Please feel free to let me know.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top