How to run UpdatePanel update from MasterPage?

I have UpdatePanela dynamically loaded UserControlone that is in TabPanelfrom TabContainer. Is it possible to specify the method asp:LinkButtonto MasterPagea trigger UpdatePanel?

+3
source share
1 answer

You can dynamically add AsyncPostBackTriggerorPostBackTrigger

Here's how you can do it:

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 on the main page, first you need to find the link.

LinkButton LinkButtonId = (LinkButton)Master.FindControl("LinkButtonId");
apTrigger.ControlID = "LinkButtonId";
+2
source

All Articles