Add the Button control inside the UpdatePanel.
Please refer this code.
HTML
<asp:ScriptManager runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" Text="Redirect" runat="server" OnClick="Redirect" />
</ContentTemplate>
</asp:UpdatePanel>
C#
protected void Redirect(object sender, EventArgs e)
{
ScriptManager.RegisterClientScriptBlock(sender as Control, this.GetType(), "alert", "window.open('TestPage2.aspx')", true);
}