Solved

Issue with UpdatePanel inside a ModalPopupExtender Panel

Posted on 2013-06-12
3
325 Views
Last Modified: 2014-06-01
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
Comment
Question by:drunk_irishman
3 Comments
 
LVL 10

Accepted Solution

by:
Monica P earned 500 total points
ID: 39243929
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question