Multiple controls with same ID error

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
WylieE
Captain (CAPT)
Captain (CAPT)
Posts: 281
Joined: Tue Mar 25, 2008 8:26 am
Location: Puyallup, WA
Contact:

Multiple controls with same ID error

Post by WylieE » Tue Oct 28, 2008 10:34 am

I get the following error when navigating to Catalog/Browse:

Server Error in '/' Application.
Multiple controls with the same ID 'C34' 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 'C34' were found. FindControl requires that controls have unique IDs.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Multiple controls with the same ID 'C34' were found. FindControl requires that controls have unique IDs.]
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +220
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +280
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +280
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +280
System.Web.UI.Control.EnsureNamedControlsTable() +57
System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +106
System.Web.UI.Control.FindControl(String id) +9
System.Web.UI.WebControls.DataBoundControlHelper.FindControl(Control control, String controlID) +68
System.Web.UI.WebControls.DataBoundControl.GetDataSource() +1863793
System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +34
System.Web.UI.WebControls.DataBoundControl.OnLoad(EventArgs e) +16
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


Build is 10125.
This AC database is a test front end for VisionCore and has a fair amount of data and activity. I connected it to a clean VC database and pushed a new category and a few new inventory items. That seems to have generated the error. I presume I ended up with a dupe keyfield somewhere. I've manually gone in to the AC tables and deleted the category and parts I had created in the new VC build, but I'm still getting the error.

Any suggestions on where I might look to resolve this error? I pray I haven't turned the data into swiss cheese.
Eric Wylie
Warmoth Guitar Products, Inc.
http://www.warmoth.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Multiple controls with same ID error

Post by mazhar » Tue Oct 28, 2008 11:31 am

Well i am quite sure that this is due to manual edits in the database. I am posting a query you can run it and it will remove the faulty ones. But read the following note first

Please take your database backup first and then run the query.

Code: Select all

DELETE FROM ac_CatalogNodes  
WHERE (CAST(ac_CatalogNodes.CategoryId as varchar) + '/' + 
CAST(ac_CatalogNodes.CatalogNodeId as varchar) + '/' + 
CAST(ac_CatalogNodes.CatalogNodeTypeId as varchar)) 
 IN ( SELECT (CAST(CN.CategoryId as varchar) + '/' + 
        CAST(CN.CatalogNodeId as varchar) + '/' + 
        CAST(CN.CatalogNodeTypeId as varchar)) as ID 
       FROM ac_CatalogNodes CN inner join ac_Categories C ON
            CN.CatalogNodeId=C.CategoryId
       WHERE CN.CatalogNodeTypeId=0 AND CN.CategoryID <> C.ParentID
   )

User avatar
WylieE
Captain (CAPT)
Captain (CAPT)
Posts: 281
Joined: Tue Mar 25, 2008 8:26 am
Location: Puyallup, WA
Contact:

Re: Multiple controls with same ID error

Post by WylieE » Tue Oct 28, 2008 1:54 pm

mazhar wrote:Well i am quite sure that this is due to manual edits in the database. I am posting a query you can run it and it will remove the faulty ones. But read the following note first

Please take your database backup first and then run the query.

Code: Select all

DELETE FROM ac_CatalogNodes  
WHERE (CAST(ac_CatalogNodes.CategoryId as varchar) + '/' + 
CAST(ac_CatalogNodes.CatalogNodeId as varchar) + '/' + 
CAST(ac_CatalogNodes.CatalogNodeTypeId as varchar)) 
 IN ( SELECT (CAST(CN.CategoryId as varchar) + '/' + 
        CAST(CN.CatalogNodeId as varchar) + '/' + 
        CAST(CN.CatalogNodeTypeId as varchar)) as ID 
       FROM ac_CatalogNodes CN inner join ac_Categories C ON
            CN.CatalogNodeId=C.CategoryId
       WHERE CN.CatalogNodeTypeId=0 AND CN.CategoryID <> C.ParentID
   )
Hi Mazhar -

You're most likely right my changes did not help the error situation. I made backups and ran your query, but it came back with 'Invalid object name 'ac_CatalogNodes'. Addmittedly my SQL is limited, but I don't see anything wrong with the query structure.
Eric Wylie
Warmoth Guitar Products, Inc.
http://www.warmoth.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Multiple controls with same ID error

Post by mazhar » Wed Oct 29, 2008 3:59 am

It seems that you tried to execute the query on some wrong database. Make sure that you have selected proper database to run the query. For this AbleCommerce database must be selected in the dropdown available in toolbar. Have a look at the image below

User avatar
WylieE
Captain (CAPT)
Captain (CAPT)
Posts: 281
Joined: Tue Mar 25, 2008 8:26 am
Location: Puyallup, WA
Contact:

Re: Multiple controls with same ID error

Post by WylieE » Wed Oct 29, 2008 11:58 am

Brilliant! Worked like a champ!

Mazhar (or other AbleCommerce staff), we'll have to grab a meal if you're ever in the greater Puget Sound area.

Thanks.
Eric Wylie
Warmoth Guitar Products, Inc.
http://www.warmoth.com

Post Reply