[RESOLVED]ModalPopupExtender disables asp controls in in other webparts

Hi,

I am having problems getting a ModalPopupExtender ajax control to work on a page.

I have a single page containing 4 or 5 web parts displaying data from a sql database.  I want to add a ModalPopupExtender that will open a popup for me to enter data into the same database.  I have got the popup opening, validating imput and saving the record
on close, but when the extenders code is on the page it disables the <asp:LinkButton> on the other web parts.  These link buttons open datalist EditItmTemplate> that are on the other web parts.

If I remove any reference to the ModalPopupExtender, the link buttons work.

A stripped down version of the code is below:

The ASPX code (recruits.aspx):

<form id="frmRecruits" runat="server">
       
       <ajaxtoolkit:toolkitscriptmanager ID="AjaxToolkitScriptManager" runat="server"/>

        <asp:WebPartManager ID="wpmRecruits" runat="server" OnAuthorizeWebPart="wpmRecruits_AuthorizeWebPart">
            <StaticConnections>
                <asp:WebPartConnection ID="wpConnRecruitDetails"
                    ConsumerID = "idRecruitDetails"
                    ProviderID="idRecruitAdminTools"
                    ConsumerConnectionPointID="SelectedRecruit"
                    ProviderConnectionPointID="SelectedRecruit" />

                           
            </StaticConnections>
 
        </asp:WebPartManager>
                
        <div id="leftNav">
            
        <asp:LinkButton ID="linkAddNewRecruit" runat="server" Text="new recruit"  />
         
<asp:webpartzone id="wpzLeftSideBar_01" runat="server">
                <ZoneTemplate>
                    <ucRecruitAdminTools:RecruitAdminTools ID="idRecruitAdminTools" runat="server" title="Recruit"/>
                                          
                </ZoneTemplate>
            </asp:webpartzone>

        </div>
        
        <div id="content">
            <div id="centreContent">
                <asp:WebPartZone ID="wpzCentre" runat="server">
                    <ZoneTemplate>
                        <ucRecruitDetails:RecruitDetails ID="idRecruitDetails" runat="server" title="Contact Details"  />
                        
                    </ZoneTemplate>
                </asp:WebPartZone>
            </div>
        </div>

        <asp:Panel ID="panelAddNewRecruit" runat="server"  CssClass="modalPopup">
            <div style="border: 1px solid #000000">

               <table style="background-color: #e3e2fe;">
                    <tr>
                        <td>Interview Date</td>
                        <td>
                            <asp:TextBox ID="txtInterviewDate" runat="server"/>
                            <ajaxToolkit:CalendarExtender ID="calInterviewDate" runat="server" TargetControlID="txtInterviewDate" />
                        </td>
                        <td>Unit</td>
                        <td>
                            <asp:DropDownList ID="ddlUnitID" runat="server">
                                <asp:ListItem Text="-Select Unit-" Value= ""></asp:ListItem>
                                <asp:ListItem Value="2643" Text="PE" />
                                <asp:ListItem Value="2641" Text="FA" />
                                
                            </asp:DropDownList>
                        </td>
                    </tr>
                      
                    <tr>
                        <td>FirstName</td>
                        <td>
                            <asp:TextBox ID="txtFirstName" runat="server"/>
                            <asp:RequiredFieldValidator ID="vldTxtFirstName" runat="server" ErrorMessage="* Required" ControlToValidate="txtFirstName" />
                        </td>
                        
                        <td>MiddleInitial</td><td><asp:TextBox ID="txtMiddleInitial" runat="server"/></td>
                        <td>LastName</td>
                        <td>
                            <asp:TextBox ID="txtLastName" runat="server"/>
                            <asp:RequiredFieldValidator ID="vldTxtLastName" runat="server" ErrorMessage="* Required" ControlToValidate="txtLastName" />
                        </td>
                    </tr>
                    <tr>
                        <td>Address</td>
                        <td><asp:TextBox ID="txtHomeAddress" runat="server"/></td>
                    </tr>
                    <tr>
                        <td>City</td><td><asp:TextBox ID="txtHomeCity" runat="server"/></td>
                        <td>State</td><td><asp:TextBox ID="txtHomeState" runat="server"/></td>
                    </tr>
                    <tr>
                        <td>ZipCode</td><td><asp:TextBox ID="txtHomeZipcode" runat="server" />-<asp:TextBox ID="txtHomeExtZipcode" runat="server"/>
                        </td>
                    </tr>
                   
                    <tr>
                        <td >
                            <asp:LinkButton ID="linkInsert" runat="server">Insert</asp:LinkButton>
                            <asp:LinkButton ID="linkCancel" runat="server">Close</asp:LinkButton>
                            
                        </td>
                    </tr>
                </table>
              
            </div>
        </asp:Panel>
  
        <ajaxToolkit:ModalPopupExtender ID="mpeAddNewRecruit" runat="server" 
                TargetControlID="linkAddNewRecruit"
                PopupControlID="panelAddNewRecruit" 
                BackgroundCssClass="modalBackground" 
                DropShadow="true" 
                CancelControlID="linkCancel" >
        </ajaxToolkit:ModalPopupExtender>
       
       </form>

ASCX code for one of the web parts (wpRecruitsDetails):

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="wpRecuitsDetails.ascx.vb" Inherits="PayPer_WebParts.wpRecuitsDetails" %>
<asp:DataList id="dataRecruitDetails" runat="server" DataKeyField="PersonID" 
        DataSourceID="dsRecruitInfoByID" 
        OnEditCommand="dataRecruitDetails_EditCommand" 
        OnCancelCommand="dataRecruitDetails_CancelCommand" 
        OnUpdateCommand="dataRecruitDetails_UpdateCommand">

    <ItemTemplate>
               
       <%-- <asp:LinkButton ID="linkEdit" runat="server" CommandName="edit">edit</asp:LinkButton>--%>
 <asp:Button ID="linkEdit" runat="server" Text="Edit" CommandName="edit" />
         <br /> <br />
       
        <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
        <asp:Label ID="lblMiddleInital" runat="server" Text='<%# Eval("MiddleInitial") %>' />
        <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>' />
        <br /><br />
        <strong>Date Hired</strong>
        <asp:Label ID="lblDateHired" runat="server" Text='<%# Eval("DateHired","{0:MMM-dd-yyyy}") %>' />
        <strong>Interview Date</strong>
        <asp:Label ID="lblInterviewDate" runat="server" Text='<%# Eval("InterviewDate","{0:MMM-dd-yyyy}") %>'/>
        <br /><br />
        
        <strong>Address</strong>
        <br />
        <asp:Label ID="lblHomeAddress" runat="server" Text='<%# Eval("HomeAddress") %>' />
        <br />
        <asp:Label ID="lblHomeCity" runat="server" Text='<%# Eval("HomeCity") %>' />
        <asp:Label ID="lblHomeState" runat="server" Text='<%# Eval("HomeState") %>' />
        <asp:Label ID="lblHomeZipcode" runat="server" Text='<%# Eval("HomeZipcode") %>' />
        <asp:Label ID="lblHomeExtZipcode" runat="server" Text='<%# Eval("HomeExtZipcode") %>' />
        <br />

    </ItemTemplate>

    <EditItemTemplate>
        
        <asp:LinkButton ID="linkUpdate" runat="server" CommandName="update">update</asp:LinkButton>
             &nbsp;
        <asp:LinkButton ID="linkCancel" runat="server" CommandName="cancel">cancel</asp:LinkButton>
            <br />
        <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
        <asp:TextBox ID="txtMiddleInitial" runat="server" Text='<%# Eval("MiddleInitial") %>' />
        <asp:TextBox ID="txtLastName" runat="server" Text='<%# Eval("LastName") %>' />
        <br /><br />
        <strong>Date Hired</strong>
        <asp:TextBox ID="txtDateHired" runat="server" Text='<%# Eval("DateHired","{0:MMM-dd-yyyy}") %>' />
        <ajaxToolkit:CalendarExtender ID="calDateHired" runat="server" TargetControlID="txtDateHired" />

        <strong>Interview Date</strong>
        <asp:TextBox ID="txtInterviewDate" runat="server" Text='<%# Eval("InterviewDate","{0:MMM-dd-yyyy}") %>' />
        <ajaxToolkit:CalendarExtender ID="calInterviewDate" runat="server" TargetControlID="txtInterviewDate" />
        <br /><br />
        
        <strong>Address</strong>
        <br />
        <asp:TextBox ID="txtHomeAddress" runat="server" Text='<%# Eval("HomeAddress") %>' />
        <br />
        <asp:TextBox ID="txtHomeCity" runat="server" Text='<%# Eval("HomeCity") %>' />
        <asp:TextBox ID="txtHomeState" runat="server" Text='<%# Eval("HomeState") %>' />
        <asp:TextBox ID="txtHomeZipcode" runat="server" Text='<%# Eval("HomeZipcode") %>' />
        <asp:TextBox ID="txtHomeExtZipcode" runat="server" Text='<%# Eval("HomeExtZipcode") %>' />
        <br />
     
    </EditItemTemplate>

</asp:DataList>

I also tried putting the popcontrol into its own ASCX web part and it would cause the same problem (and if I removed it from the <ZoneTemplate> the EditItemTemplates would work again).

Any suggestions?  I can post more code if need be

thanks

Ian

Hi,

Have you debug your code and see what make the issue?

Best wishes,

Leave a Reply