I'm having a problem calling modalpopupextenders from inside an update panel. For some reason it's calling all of the popups instead of just the one specified in the code.
Here's the code:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestupdatePanel.aspx.vb" Inherits="ASPWebAppVB.TestupdatePanel" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><ajax:ToolkitScriptManager runat="Server" /><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Button ID="Popup1Button" runat="server" Text="Show Popup 1" />  <asp:Button ID="TestUpdatePanelButton" runat="server" Text="Button" /><asp:Label ID="TestUpdatePanelLabel" runat="server" Text="Label"></asp:Label><br /><br /><asp:Button ID="Popup2Button" runat="server" Text="Show Popup 2" /></ContentTemplate></asp:UpdatePanel><br /><br /><asp:Button ID="Button3" runat="server" Text="TestPostback" /><asp:Panel ID="ModalPanel1" runat="server" Width="600px" BackColor="#999999" BorderColor="Black" BorderStyle="Solid" BorderWidth="3px">
Modal Panel 1<br /><asp:Button ID="ModalPanel1YesButton" runat="server" Text="Yes" OnClick="ModalPanel1Yes"/> <asp:Button ID="ModalPanel1NoButton" runat="server" Text="No" /></asp:Panel><ajax:ModalPopupExtender ID="ModalPanel1MPE" runat="server" TargetControlId="HiddenButton" PopupControlID="ModalPanel1" /><asp:Panel ID="ModalPanel2" runat="server" Width="300px" BackColor="#999999" BorderColor="Black" BorderStyle="Solid" BorderWidth="3px">
Modal Panel 2<br /><asp:Button ID="ModalPanel2YesButton" runat="server" Text="Yes" OnClick="ModalPanel2Yes"/> <asp:Button ID="ModalPanel2NoButton" runat="server" Text="No" /></asp:Panel><ajax:ModalPopupExtender ID="ModalPanel2MPE" runat="server" TargetControlId="HiddenButton" PopupControlID="ModalPanel2" /><asp:Button ID="HiddenButton" style="display:none" runat="server" Text="Button" /></div></form></body></html>and the code behind:
PublicClassTestupdatePanelInheritsSystem.Web.UI.PageProtectedSubPage_Load(ByVal sender AsObject,ByVal e AsSystem.EventArgs)HandlesMe.LoadEndSubProtectedSubTestUpdatePanelButton_Click(sender AsObject, e AsEventArgs)HandlesTestUpdatePanelButton.ClickIfTestUpdatePanelLabel.Text="Yes"ThenTestUpdatePanelLabel.Text="No"ElseTestUpdatePanelLabel.Text="Yes"EndIfEndSubProtectedSubPopup1Button_Click(sender AsObject, e AsEventArgs)HandlesPopup1Button.ClickModalPanel1MPE.Show()EndSubPublicSubModalPanel1Yes()TestUpdatePanelLabel.Text="Panel 1"EndSubProtectedSubPopup2Button_Click(sender AsObject, e AsEventArgs)HandlesPopup2Button.ClickModalPanel2MPE.Show()EndSubPublicSubModalPanel2Yes()TestUpdatePanelLabel.Text="Panel 2"EndSubEndClass
Pressing either Show Popup buttons displays both modalpopups.
The test update panel button is just used to test that the update panel is working without posting back the entire page (changes the label text). The TestPostback button is just used to test that anything outside the updatepanel is posting back the entire page.
Anybody got any idea why this isn't working? It works fine if I remove/comment out the update panel. I have also tried putting the ModalPopupExtenders/Panels/Hidden Button inside the update panel but the same thing happens.