开发者

How to trigger UpdatePanel update from MasterPage?

I have an UpdatePanel in a dynamically loaded UserControl, which is in a TabPanel of a TabContainer. Is it poss开发者_如何转开发ible to specify in markup an asp:LinkButton in the MasterPage as an UpdatePanels trigger?


You can dynamically add a AsyncPostBackTrigger or PostBackTrigger

Here is how can you do this:

AsyncPostBackTrigger apTrigger = new AsyncPostBackTrigger();
apTrigger.ControlID = "LinkButtonId";
apTrigger.EventName = "Click";
((UpdatePanel)((TabPanel)TabContainID.FindControl("tabPanel")).FindControl("UpdatePanelID")).Triggers.Add(apTrigger);

Edit: If the control is in a Master Page then first you need to find the LinkButton.

LinkButton LinkButtonId = (LinkButton)Master.FindControl("LinkButtonId");
apTrigger.ControlID = "LinkButtonId";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜