views:

15

answers:

1

I would like to have a button in my child control be an asyncpostback trigger for an update panel in my main/parent control. Any simple solutions? And is this bad practice? If so why? Thank you.

A: 

Your child control would be your trigger, and then the click event of the button within the child control would need to trigger the child control's exposed event that the update panel is listening on.

A less encapsulated method would be to pass a reference to the update panel into the child control and have the child control's button call update. Again, no encapsulation, but I've had to implement some workarounds when dealing with update panels.

MCain
Ok thanks this worked. However it does not seem to be working in firefox when running under IIS. I am using asp.net v4.0 app pool on IIS 7.0. It does work when using the VS2010 development server. Any ideas?
Thomas
Do you have javascript enabled in FF? Did you try Chrome or another browser?
MCain
yes I have javascript enabled.It only works itermitently
Thomas