More in this section

Forums / General Discussions / Multiple controls with the same ID were found

Multiple controls with the same ID were found

5 posts, 0 answered
  1. Phil
    Phil avatar
    89 posts
    Registered:
    19 Oct 2010
    03 Nov 2010
    Link to this post

    I am working in SiteFinity 4.0 Beta.  I created a simple ascx control and have registered it in the Toolbox, and am able to drag and drop it onto a page in the SF designer.  It has a button and a textbox. When you click the button, it writes a message in the textbox.)  I can view the page, but when I click the button I get the error below.

    In addition to the ascx control there is a Content Block, a News widget, and my version of the Jobs control that is found in SF's "How to create a basic module" tutorial.  The page works fine without the new ascx control on it.  Please advise.


    ERROR MESSAGE -------------------------------------------------------------

    Multiple controls with the same ID 'C000' were found. FindControl requires that controls have unique IDs.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Multiple controls with the same ID 'C000' were found. FindControl requires that controls have unique IDs.

    Stack Trace:

    [HttpException (0x80004005): Multiple controls with the same ID 'C000' were found. FindControl requires that controls have unique IDs.]
       System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +634
       System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +359
       System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +359
       System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +207
       System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +293
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2996
    

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Nov 2010
    Link to this post
    Hi Phillip,

    Could you replicate the same issue on BETA2 version? If the problem persist, please send the user control you use (ascx and cs files)

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Phil
    Phil avatar
    89 posts
    Registered:
    19 Oct 2010
    03 Nov 2010
    Link to this post
    I just found that the page works fine at each of the following steps:
     - delete all the controls on the page except the new ascx control
     - add each of the controls that WERE on the page, one at a time

    So, the page is working fine now, with all the same controls on there that I originally had.  This, of course, is a workaround.  If anyone has a solution or ideas for a solution, I would still appreciate that.

    Thanks.
  4. Phil
    Phil avatar
    89 posts
    Registered:
    19 Oct 2010
    03 Nov 2010
    Link to this post
    I am using SiteFinity 4.0 Beta 2 (according to the splash screen)  - sorry for missing that detail in the original post.
    (The Attach File button is saying this:  Allowed extensions: .jpg, .jpeg, .gif, .png  So I am pasting them in here,)  Thanks.

    ascx file =======================================================================

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="FunWithControls.ascx.cs" Inherits="UserControls_FunWithControls" %>
    <div>
    <br />
        <asp:Button ID="Button1" runat="server" Text="Click for fun." Width="160px"
            onclick="Button1_Click" />
        <br />
        <asp:TextBox ID="TextBox1" runat="server" Width="231px"></asp:TextBox>
        <br /><br />
    </div>

    cs file =================================================================

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class UserControls_FunWithControls : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {      }
        protected void Button1_Click(object sender, EventArgs e)
        {
            TextBox1.Text = "A state of mind, huh.";
        }
    }
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Nov 2010
    Link to this post
    Hi Phillip,

    Thank you for sending the code to me. I created a user control and added it to a page, but I was not able to replicate this issue. I attached a sample video for you.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
5 posts, 0 answered