try this
<asp:ModalPopupExtender ID="Panel2_ModalPopupExtender" runat="server" TargetControlID="Button1"
PopupControlID="Panel2" DynamicServicePath="" >
</asp:ModalPopupExtender>
<asp:Button ID="Button1" runat="server" Text="" style="visibility:hidden" />
<asp:Button ID="Button2" runat="server" Text="Click" onclick="Button2_Click" />
/*
take One dummy button on TargetControlID="Button1" and set style="visibility:hidden" like Above
take Another Button [ID="Button2" ]
in the Code Behind */
protected void Button2_Click(object sender, EventArgs e)
{
Panel2_ModalPopupExtender.Show();
}