AJAX Modal Popup page not unlocked after hide

I have a GridView with a button on each row when clicked displays a modal popup panel with values based upon the row selected. I have the ModalPopupExtender working fine (thanks to some wonderful work from http://www.mattberseth.com/) but the problem I have is that when I save the data, the page is not unlocked. The database is updated and the modal popup goes away, but the background page remains locked. Any ideas on how to resolve this?

<asp:Panel ID="pnlTradingPartnerSetup" runat="server" GroupingText="Trading Partner Setup"
                Height="50%">
                <asp:Table ID="tblTPS" runat="server" EnableViewState="false" Width="1000px" CellSpacing="0"
                    CellPadding="0" GridLines="Both">
                    <asp:TableRow>
                        <asp:TableCell Width="145px">
                            <asp:TextBox ID="txtTPS_TradingPartnerNbr_QBE" runat="server" BorderStyle="None"
                                BorderColor="Black" Width="99%" /></asp:TableCell>
                        <asp:TableCell Width="193px">
                            <asp:TextBox ID="txtTPS_TradingPartnerName_QBE" runat="server" BorderStyle="None"
                                BorderColor="Black" Width="99%" /></asp:TableCell>
                        <asp:TableCell Width="240px">
                            <asp:TextBox ID="txtTPS_Description_QBE" runat="server" BorderStyle="None" BorderColor="Black"
                                Width="98%" /></asp:TableCell>
                        <asp:TableCell Width="95px">
                            <asp:DropDownList ID="ddlTPS_Enabled_QBE" runat="server" Width="99%">
                                <asp:ListItem Text="" Value="" />
                                <asp:ListItem Text="Active" Value="Y" />
                                <asp:ListItem Text="InActive" Value="N" />
                            </asp:DropDownList>
                        </asp:TableCell>
                        <asp:TableCell Width="145px">
                            <asp:TextBox ID="txtTPS_InboundDirectory_QBE" runat="server" BorderStyle="None" BorderColor="Black"
                                Width="99%" /></asp:TableCell>
                        <asp:TableCell Width="145px">
                            <asp:TextBox ID="txtTPS_OutboundDirectory_QBE" runat="server" BorderStyle="None"
                                BorderColor="Black" Width="99%" /></asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
                <asp:UpdatePanel ID="updatePanelTPS" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Panel runat="server" ScrollBars="None" Height="650px" Width="1020px">
                            <asp:GridView ID="grdTPS_TradingPartners" runat="server" Width="1000px" GridLines="Both"
                                AutoGenerateColumns="false" CssClass=".GVFixedHeader" BorderStyle="Solid" BorderColor="Black"
                                OnSelectedIndexChanged="grdTPS_TradingPartners_SelectedIndexChanged">
                                <HeaderStyle CssClass="Grid_HeaderStyle" VerticalAlign="Top" HorizontalAlign="Center" />
                                <AlternatingRowStyle CssClass="Grid_AlternatingRowStyle" />
                                <RowStyle CssClass="Grid_RowStyle" />
                                <Columns>
                                    <asp:BoundField DataField="trading_partner_id" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol" />
                                    <asp:BoundField DataField="trading_partner_number" HeaderText="Partner Number" ItemStyle-Width="150px" />
                                    <asp:BoundField DataField="trading_partner_name" HeaderText="Partner Name" ItemStyle-Width="200px" />
                                    <asp:BoundField DataField="description" HeaderText="Description" ItemStyle-Width="250px" />
                                    <asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
                                        <HeaderTemplate>Active</HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkTPS_Enabled" runat="server" Checked='<%# Eval("active").ToString()=="Y"?true:false %>' Enabled="false" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="inbound_directory" HeaderText="Inbound Directory" ItemStyle-Width="150px" />
                                    <asp:BoundField DataField="outbound_directory" HeaderText="Outbound Directory" ItemStyle-Width="150px" />
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="btnEditTridingPartner" runat="server" Text="Edit" CommandName="Select" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <br />
                <table width="1000px">
                    <tr align="right">
                        <td>
                            <asp:Button ID="btnSearch_TradingPartner" runat="server" Text="Search" OnClick="btnSearch_TradingPartner_Click" CssClass="button" />
                            <asp:Button ID="btnTPS_AddNew" runat="server" Text="AddNew" CssClass="button" OnClick="btnTPS_AddNew_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnlEditTradingPartner" runat="server" Style="display: none" CssClass="modalPopup">
                <dir style="margin: 10px">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel_ModalEditTradingPartner" RenderMode="Inline"
                        UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:Button ID="btnShowTPSPopup" runat="server" Style="display: none" />
                            <cc1:ModalPopupExtender runat="server" ID="ModalPopupEditTradingPartner" TargetControlID="btnShowTPSPopup"
                                PopupControlID="pnlEditTradingPartner" BackgroundCssClass="modalBackground" CancelControlID="btnTPS_Cancel"/>
                            <div align="center" runat="server">
                                <asp:Label ID="lblPopupHeader" runat="server" Width="100%" Font-Bold="true" />
                            </div>
                            <hr />
                            <table width="100%">
                                <tr>
                                    <td><asp:Label ID="Label1" runat="server" Text="Partner Number" EnableViewState="false" /></td>
                                    <td><asp:TextBox runat="server" ID="txtTPS_TradingPartnerNumber_Edit" MaxLength="15" /></td>
                                </tr>
                                <tr>
                                    <td><asp:Label ID="Label2" runat="server" Text="Partner Name" EnableViewState="false" /></td>
                                    <td><asp:TextBox runat="server" ID="txtTPS_TradingPartnerName_Edit" MaxLength="50" Columns="20" /></td>
                                </tr>
                                <tr>
                                    <td><asp:Label ID="Label3" runat="server" Text="Description" EnableViewState="false" /></td>
                                    <td><asp:TextBox runat="server" ID="txtTPS_Description_Edit" Columns="25" /></td>
                                </tr>
                                <tr>
                                    <td><asp:Label ID="Label4" runat="server" Text="Inbound Directory" EnableViewState="false" /></td>
                                    <td><asp:TextBox runat="server" ID="txtTPS_InboundDirectory_Edit" Columns="30" /></td>
                                </tr>
                                <tr>
                                    <td><asp:Label ID="Label5" runat="server" Text="Outbound Directory" EnableViewState="false" /></td>
                                    <td><asp:TextBox runat="server" ID="txtTPS_OutboundDirectory_Edit" Columns="30" /></td>
                                </tr>
                                <tr>
                                    <td><asp:HiddenField ID="hfTPS_Trading_Partner_ID" runat="server" /></td>
                                    <td><asp:CheckBox ID="chkTPS_Active_Edit" runat="server" Text="Active" /></td>
                                </tr>
                            </table>
                            <hr />
                            <div align="center">
                                <asp:Button runat="server" ID="btnTPS_Save" Text="Save" OnClick="btnSave_TradingPartner_Click" CausesValidation="true" />
                                <asp:Button runat="server" ID="btnTPS_Cancel" Text="Cancel" CausesValidation="false" />
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </dir>
            </asp:Panel>
 
  protected void btnSave_TradingPartner_Click(object sender, EventArgs e)
    {
        //Get Empty Dataset with one blank record to build XML
        DataTable dt = Initialize_Trading_Partner_Table();
 
        //Set Values to update
        dt.Rows[0]["trading_partner_id"] = this.hfTPS_Trading_Partner_ID.Value;
        dt.Rows[0]["trading_partner_number"] = this.txtTPS_TradingPartnerNumber_Edit.Text;
        dt.Rows[0]["trading_partner_name"] = this.txtTPS_TradingPartnerName_Edit.Text;
        dt.Rows[0]["description"] = this.txtTPS_Description_Edit.Text;
        dt.Rows[0]["inbound_directory"] = this.txtTPS_InboundDirectory_Edit.Text;
        dt.Rows[0]["outbound_directory"] = this.txtTPS_OutboundDirectory_Edit.Text;
 
        if (chkTPS_Active_Edit.Checked)
        {
            dt.Rows[0]["active"] = "Y";
        }
        else
        {
            dt.Rows[0]["active"] = "N";
        }
 
        //Create XML from Recordset
        string trading_partner_xml = clsDataUtility.CreateXML(dt, true);
 
        //Save Data
        EDM.SaveTradingPartner(trading_partner_xml);
 
 
        updatePanelTPS.Update();
 
        //Hide model Popup
        this.ModalPopupEditTradingPartner.Hide();
 
    }

Open in new window

drawalegnaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

prairiedogCommented:
Try moving the ModalPopupExtender outside of pnlEditTradingPartner.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
drawalegnaAuthor Commented:
Thanks a bunch. I had tried that but got the following error.
      An extender can't be in a different UpdatePanel than the control it extends.

I moved the pnlEditTradingPartner panel inside the UpdatePanel and moved the ModalPopupExtender  outside the pnlEditTradingPartner but still within the UpdatePanel and it worked. I will award you the points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AJAX

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.