I have a user control placed inside an update panel, ie like this.
<asp:UpdatePanel ID="testupdatepnl" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<uc1:TestControl ID="ctlTest" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
Now i got a button placed inside this user control say Click. I want to postback the whole page on the button click. I tried to add a postback trigger like this
<Triggers>
<asp:PostBackTrigger ControlID="clickButton" />
</Triggers>
Since the button is inside the usercontrol , i got error while running like this.
Is there any way to do a postback for this button.
Remove the <Triggers>
from HTML & Add this to PageLoad
event
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
scriptManager.RegisterPostBackControl(WebUserControl11.FindControl("ButtonId"));
Note : Learned from this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With