Tuesday 9 February 2010

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

I was having this issue last year when I upgraded a website from ASP.NET 2.0 to 3.5, and it took me ages to figure out what was going wrong.

Since then I've had developers thanking me for the solution so I thought I'd blog about it in case others are having a similar problem :)

Basically it seems with 3.5 each AJAX Control Toolkit Accordion Pane needs its own ID and to be ran at server. Then, when rendered the header appears as 'accordionpaneid_header' and the content appears as 'accordionpaneid_content'.

As none of my accordion panes had an id, they were all rendering as '_header', which obviously can't be allowed. I would imagine that if the header wasnt causing an error, the next error would be on '_content'.

So if you simply put an ID and 'runat="server"' on each of your existing accordion panes, you should no longer get this error.

No comments:

Post a Comment