I am just learning how to use the UpdatePanel control, so please be patient with me.
I think I understand the concept of wiring ControlID/EventName combinations to the UpdatePanel's collection of triggers.
It seems fairly straight forward if you are wiring up a standard Button control, but in my case, I would like to wire a button control embedded in a user control or DataGrid control. I attempted to expose the button as a public property of the user control and tried to wire it up ("UserControl.MyButton" and "Click"), but I get the
"A control with ID 'WebUserControl1.MyButton' could not be found for the trigger in UpdatePanel 'UpdatePanel1'. "
error message.
I also would like to do the same with a button embedded in a datagrid, but that seems to be a tall order.
Thanks much in advance.
It seems strange at first but you can add the usercontol/datagrid (the button's parent control) as a trigger for the updatepanel. Maybe that is enough for you.
(You can also force the updatepanel to refresh in the server side: you handle your button click event server side and then simple call the update method of any updatepanel to your taste)
stmarti:
It seems strange at first but you can add the usercontol/datagrid (the button's parent control) as a trigger for the updatepanel. Maybe that is enough for you.
(You can also force the updatepanel to refresh in the server side: you handle your button click event server side and then simple call the update method of any updatepanel to your taste)
Could you give me an example of what the code ought to look like? I am not following you. Thank you.
hello.
well, just pass the id of the grid instead of passing the id of the button you've defined on the template.
Thanks. Works.
No comments:
Post a Comment