Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript runtime error: Sys.InvalidOperationException: Two components with the same id 'mpeAttachment' can't be added to the application.

But i use different types of ID only for modal Popup mpeAttachment and mpetimeout

Anybody Please Solve this issue

<asp:HiddenField runat="server" ID="HiddenAttachment" />
   <asp:ModalPopupExtender ID="mpeAttachments" PopupControlID="pnlAttachments" runat="server"
       CancelControlID="lnkExit" TargetControlID="HiddenAttachment" BackgroundCssClass="modalBackground">
   </asp:ModalPopupExtender>
   <asp:Panel runat="server" ID="pnlAttachments" CssClass="modalPopup" Style="width: 456px;
       height: 266px;">
       <table width="100%">
           <tr>
               <td class="blankrow">
               </td>
               <td>
               </td>
           </tr>
           <tr>
               <td style="font-size: 20px; font-style: normal">
                   File Attachment
               </td>
           </tr>
           <tr>
               <td class="blankrow">
               </td>
               <td>
               </td>
           </tr>
           <tr>
               <td>
                   <asp:Label runat="server" ID="lblbrowse" Text="Step 1- click browse to select a file from your computer" />
               </td>
           </tr>
           <tr>
               <td>
                   <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                       <ContentTemplate>
                           <asp:FileUpload ID="FileUploadControl" Style="width: 445px;" runat="server" />
                       </ContentTemplate>
                       <Triggers>
                           <asp:PostBackTrigger ControlID="btnUpload" />
                       </Triggers>
                   </asp:UpdatePanel>--%>
               </td>
           </tr>
           <tr>
               <td>
                   <asp:Label ID="lblAttachmentDescription" runat="server" Text="Step 2- give me a brief description of this file" />
                   <asp:Label ID="lblErrorMessage" runat="server" Visible="false" Style="float: left;
                       color: red;"></asp:Label>
               </td>
           </tr>
           <tr>
               <td>
                   <asp:TextBox runat="server" Width="442px" ID="txtAttachmentDescription" />
                   <%--<asp:RequiredFieldValidator runat="server" id="valid1" ControlToValidate="txtAttchmentDescription" ErrorMessage="enter" />--%>
               </td>
           </tr>
           <tr>
               <td>
                   <asp:Label ID="lblselectfile" runat="server" Text="Step 3- click upload to upload a selected file" />
               </td>
           </tr>
           <tr>
               <td align="right">
                   <asp:Button ID="btnUpload" Style="display: block" Width="84px" runat="server" Text="Upload" />
               </td>
           </tr>
           <tr>
           </tr>
           <tr>
               <td align="center">
                   <asp:LinkButton ID="lnkExit" runat="server" Text="Cancel" Font-Underline="true" Style="color: Blue;" />
               </td>
           </tr>
       </table>
   </asp:Panel>


And my another modal popup

<asp:ModalPopupExtender ID="mpetimeout" PopupControlID="pnltimeout" BehaviorID="mpetimeout"
       runat="server" TargetControlID="Hidden1" BackgroundCssClass="modalBackground">
   </asp:ModalPopupExtender>
   <asp:HiddenField runat="server" ID="Hidden1" />
   <asp:Panel ID="pnltimeout" runat="server" CssClass="modalPopup" Style="width: 390px;">
       <table width="100%">
           <tbody>
               <tr>
                   <td align="center">
                       Security Alert
                   </td>
               </tr>
               <tr align="center">
                   <td>
                       Your session have been idle for some time now.<br />
                       For security purpose the session will be terminated in <span id="myCounter" style="color: Red">
                       </span>seconds.
                       <br />
                       If you want to continue, you should save the data otherwise select logout.
                   </td>
               </tr>
           </tbody>
       </table>
       <table width="100%">
           <tr align="center">
               <td>
                   <asp:Button runat="server" Text="Logout" ID="btnSessionNo" />
                   <asp:Button runat="server" Text="SaveData" OnClientClick="return myStopFunction();"
                       ID="btnSessionYes" />
               </td>
           </tr>
       </table>
   </asp:Panel>


thanks in Advance
Posted
Updated 9-Apr-14 5:47am
v3
Comments
Richard C Bishop 9-Apr-14 10:28am    
Show the code, the exception is not lying to you.
[no name] 9-Apr-14 10:31am    
means?expert
Richard C Bishop 9-Apr-14 10:43am    
You need to show us your code so that we can tell where the issue is occurring. The exception that is being thrown says there are two components with the same id, one needs to be changed. If you want help here, you need to post the code.
[no name] 9-Apr-14 11:33am    
I had Updated my Question please Check it out
Richard C Bishop 9-Apr-14 11:50am    
Ok, thank you for adding the code. Now, is there any code-behind that is setting an id for any of the controls?

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900