Multiple controls with the same ID were found

Posted by Community Admin on 03-Aug-2018 14:04

Multiple controls with the same ID were found

All Replies

Posted by Community Admin on 03-Nov-2010 00:00


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

Posted by Community Admin on 03-Nov-2010 00:00

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

Posted by Community Admin on 03-Nov-2010 00:00

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.

Posted by Community Admin on 03-Nov-2010 00:00

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.";
   

Posted by Community Admin on 04-Nov-2010 00:00

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

This thread is closed