I was workign with a small application where i create Accordion runtime. I i got problem for that the problem was “The TargetControlID of ‘_AccordionExtender’ is not valid. The value cannot be null or empty”. I wrote codes like that
Finally got the solution just add accordion.ID = “AccordionID” and this problem is solved. So the fixed code is look like that




Dear Ashraf,
I get the same error message but specifiying ID doesnt solve the problem. I have 2 web applications with accordion , in one application it works howerver it does’nt work on otherone even i have copy the code from one that works to another one that does’nt work.Could you please assist me?
Hi,
I got you this is really a bad experiance for you. But i have never face such problem. Is it possible that you can give me you web project where Accordion is not woking so I could tried to help you. I check with two differect web project in my pc and its working.
Thanks. This post help me
Hi,
I had a similar issue with with the AccodionExtender, too.
To correct it, open the AjaxControlToolkit source project (you’ll need to download and reference this assembly if your currently using the binary download in your project) and add the following code to the Accodion.cs file (anywhere in the ‘public class Accordion : WebControl’ class):
public override string ID
{
get
{
if (String.IsNullOrEmpty(base.ID))
{
base.ID = “Accordion_” + DateTime.Now.ToBinary().ToString();
}
return base.ID;
}
set
{
base.ID = value;
AccordionExtender.ID = value + “_AccordionExtender”;
AccordionExtender.TargetControlID = value;
}
}
I hope this helps.