Child user control Button as AsyncPostbackTrigger for update panel on parent control
I would like to have a button in 开发者_StackOverflow社区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.
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.
精彩评论