Solved

asp modal popup extender duplicate component id error

Posted on 2010-09-10
4
1,619 Views
Last Modified: 2012-05-10
Modal Popup Extender Error
Page-Title.doc
0
Comment
Question by:arvee2003
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:rajeeshmca
ID: 33659649
can u tell wht the error is... i am not able to see the attachmnet
0
 

Author Comment

by:arvee2003
ID: 33665326
This is my main page in which I have collapisible panel and my phone gridview is contained in it.

I am getting duplicate component id error ( screen shots at the end).First time on click it opens
with modal popup correctly. But when I tried to cancel (hide the popup) it gives two components with
same id error.

Microsoft JScript runtime error: Sys InvalidOperationException: Two
components with same id. 'ct100_ContentPlaceHolder1_ucopsphone_mdlPopupPhone can't be added to the application.

I tried setting ScriptMode=”release”
the duplicate component error goes away but the modal up shows up more than 1 instance of the popup.During
first popup only one is shows and during subsequent it keeps on adding modal popups. (second click it has
2 and so on).

My requirements.
1.      to get rid of these errors
2.      to close the modal popup on cancel which is contained with in the <edititemtemplate> of formview
modal popup.

Main GridView User Control Page.
-------------------------------

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/basemaster.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register TagPrefix="ucophone" TagName="ucopsphone" Src="~/UserControls/online_app_phone_gv.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <ContentTemplate>
         <asp:CollapsiblePanelExtender
             ID="CollapsiblePanelExtenderPhone" runat="server"  
             TargetControlID="PanelContentPhone"
             SuppressPostBack="True" >
         </asp:CollapsiblePanelExtender>
         <asp:Panel ID="PanelContentPhone" runat="server" CssClass="collapsePanel">
            <div style="margin-left:65px;">
               <ucophone:ucopsphone id="ucopsphone" runat="server" />              
             </div>
         </asp:Panel>      
       </ContentTemplate>
     </asp:UpdatePanel>
  </div>
  </asp:Content>


Gridview UserControl(ascx) which contains modalpopup

<%@ Control Language="C#" ClassName="online_app_phone_gv" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ import Namespace="Oracle.DataAccess.Client" %>
<%@ import Namespace="Oracle.DataAccess.Types" %>

<script runat="server">

     protected void GridViewAppPhone_RowCommand(object sender, GridViewCommandEventArgs e)
     {
         switch (e.CommandName)
         {
             case ("Insert"):
                 doEditViewPhone(strkey1, strkey2, "Insert");
                 break;
             case ("View"):
                 doEditViewPhone(strkey1, strkey2, "View");
                 break;
             case ("Select"):
                 doEditViewPhone(strkey1, strkey2, "Select");
                 break;                                                            
             default:
                 break;            
         }
     }
 
     protected void FormViewOnlinePhone_ItemCommand(object sender, FormViewCommandEventArgs e)
     {
         FormViewRow row = FormViewOnlinePhone.Row;
         if (e.CommandName == "Update")
         {
              // call update procedure
         }

         if (e.CommandName == "Insert")
         {

                            // call insert procedure

         }

         if (e.CommandName == "Cancel")
         {

             // Hide Popup
         }
     }    
</script>  
<script type="text/javascript">
    function cancelClick()
    {
      this._popup = $find('mdlPopup');
      this._popup.hide();
    }
</script>
<asp:UpdatePanel id="updPnlPhoneList" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
       <asp:GridView ID="GridViewAppPhone" runat="server"  >
            <asp:TemplateField ShowHeader="false" HeaderText="Commands">
                <ItemTemplate>
<asp:LinkButton id="btnViewPhoneDetails" CommandName="View" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" Text=”Edit"  CausesValidation="False" runat="server" ToolTip="View Record"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>  
       </asp:GridView>
       <asp:SqlDataSource ID="SqlDataSourcePhone" runat="server </asp:SqlDataSource>
  </ContentTemplate>
 </asp:UpdatePanel>
 

 <asp:Panel ID="pnlPopupPhone" runat="server" CssClass="modalPopupBackground">
     <asp:UpdatePanel ID="updPnlPhoneDetail" runat="server"   UpdateMode="Conditional"
                        ChildrenAsTriggers="true">
         <ContentTemplate>
              <asp:Button ID="btnShowPopupPhone" runat="server" style="display:none"
                           usesubmitbehavior="false" />
              <asp:ModalPopupExtender ID="mdlPopupPhone" runat="server"
                     PopupControlID="pnlPopupPhone"
                     TargetControlID="btnShowPopupPhone"
                     Enabled="True">
              </asp:ModalPopupExtender>
              <asp:FormView ID="FormViewOnlinePhone" runat="server"
                    DataSourceID="ObjectDataSource1"
                    DefaultMode="Edit" OnItemCommand="FormViewOnlinePhone_ItemCommand">  
                  <EditItemTemplate>
                     <div style=" text-align:right;width:400px;">
                            <asp:LinkButton ID="LinkButton1" runat="server" usesubmitbehavior="false"  
                             CausesValidation="True"  CommandName="Update" Text="Update" />&nbsp;
                        <asp:LinkButton ID="LinkButton2" runat="server"   CausesValidation="False"
                             CommandName="Cancel" Text="Cancel" usesubmitbehavior="false" />
                     </div>      
                  </EditItemTemplate>
              </asp:FormView>
          </ContentTemplate>      
     </asp:UpdatePanel>
     <div style=" text-align:right;width:420px;">
        <asp:Button ID="btnClose" styel=”display:none;" runat="server"
                    CausesValidation="False"  Text="Cancel" usesubmitbehavior="false” />
      </div>    
</asp:Panel>
<asp:TextBox id="txtAppId" Text="" runat="server" Visible
0
 
LVL 15

Expert Comment

by:rajeeshmca
ID: 33669279
Are u calling the user control twice in the page
0
 

Accepted Solution

by:
arvee2003 earned 0 total points
ID: 33678868

Temporarily Solved.

I removed Update panel which was housing the collapsible panel and the error were gone.

Looks like too much panels and update panel is causing errors

Thanks
Suresh
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Client Validating 2 date fields, required & comparison 1 42
Linq asp.net mvc 13 17
How to filter by key press ? 6 25
Data organization issue 7 20
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 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