[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

Issue with UpdatePanel inside a ModalPopupExtender Panel

I have a ModalPopupExtender that is firing and showing a Panel. Inside that Panel is an UpdatePanel. The Panel has some form fields on it to gather some info, the user clicks a Preview button (trigger button for UpdatePanel) and the code fires off without a hitch. Then when I go to close the ModalPopupExtender, I get the following error:

Microsoft JScript runtime error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.

With a button for Break, Continue, and Ignore.

Here is my ModalPopupExtender Call:

<ajaxToolkit:ModalPopupExtender runat="server" ID="ModalPopupExtender4" TargetControlID="btnSFHEnv" PopupControlID="PnlSFHEnvPopup" DropShadow="true"  BackgroundCssClass="ModalPopupCSS" />

Open in new window


And my popup Panel:

 <asp:Panel runat="server" ID="PnlSFHEnvPopup" Width="985px" BackColor="#74606c" >
    <table>
    <tr>
    <td><asp:Label ID="Label1" runat="server" Text="Custom Text 1" ForeColor="White" Font-Bold="true" /></td>
    <td><asp:Label ID="Label3" runat="server" Text="Custom Text 2" ForeColor="White" Font-Bold="true" /></td>
    <td><asp:Label ID="Label4" runat="server" Text="Custom Text 3" ForeColor="White" Font-Bold="true" /></td>
    </tr>
            <tr>
                <td><asp:TextBox runat="server" ID="txtCustomEnv1" Width="150px" /></td>
                <td><asp:TextBox runat="server" ID="txtCustomEnv2" Width="150px" /></td>
                <td><asp:TextBox runat="server" ID="txtCustomEnv3" Width="150px" /></td>
            </tr>
            <tr>
                <td colspan="3">
                    <ajaxToolkit:TextBoxWatermarkExtender runat="server" ID="TextBoxWatermarkExtender1" TargetControlID="txtCustomEnv1" WatermarkText="123 Main St." WatermarkCssClass="Watermark"  />
                    <ajaxToolkit:TextBoxWatermarkExtender runat="server" ID="TextBoxWatermarkExtender2" TargetControlID="txtCustomEnv2" WatermarkText="Suite 1000" WatermarkCssClass="Watermark"  />
                    <ajaxToolkit:TextBoxWatermarkExtender runat="server" ID="TextBoxWatermarkExtender3" TargetControlID="txtCustomEnv3" WatermarkText="City, ST  ZipCode" WatermarkCssClass="Watermark"  />
                    </td>
            </tr>
            <tr>
                <td align="center" colspan="3">
                    <asp:UpdatePanel runat="server" ID="UpdEnvPanel" UpdateMode="Conditional" >
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnEnvPreview" EventName="Click" />
                        </Triggers>
                        <ContentTemplate>
                            <table>
                                <tr>
                                    <td><asp:Button runat="server" ID="btnEnvPreview" Text="Preview" 
                        onclick="btnEnvPreview_Click" /></td>
                                </tr>
                                <tr>
                                    <td><asp:Image runat="server" ID="ImgSFHEnv_LG" ImageUrl="images/SFHEnv.jpg"/></td>
                                </tr>
                            </table>

                        </ContentTemplate>
                    </asp:UpdatePanel>                                                                                                       
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Button runat="server" ID="btnEnvAddToCart" Text="Add to Cart" onclick="btnEnvAddToCart_Click" 
                         /></td>
            </tr>            
        </table>        
    </asp:Panel>

Open in new window


Any ideas? I tried stripping out all the excess code and it's not until I add the UpdatePanel that I start getting the error.
0
drunk_irishman
Asked:
drunk_irishman
1 Solution

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now