Refreshing an asp.net page from a control in another control

asp.net, refresh, user-controls

Solution

If you want to reload the entire page (and not just the content of the UpdatePanels) you can do:

Page.Response.Redirect("mypagename.aspx");

Problem

I want to refresh my asp.net page after someone clicks an "Add" button. However, the "Add" button is part of user control inside another user control and the child control and parent control are both wrapped in Update Panels: Code below is cut short for display, there's a reason the user control is inside another user control Inside first control: ``` <ajax:UpdatePanel ID="Panel1" runat="server" UpdateMode="Always"> <ContentTemplate> <uc:Control2 ID="Custom2" runat="server" /> </ContentTemplate> </ajax:UpdatePanel> ``` Then inside control2 ``` <ajax:UpdatePanel ID="Panel2" runat="server" UpdateMode="Always"> <ContentTemplate> <asp:LinkButton ID="AddButton" runat="server" OnClick="AddButton_Click"</asp:LinkButton> </ContentTemplate> </ajax:UpdatePanel> ```

Original source