Donate

Multiple controls with the same ID '_header' were found. FindControl requires In Asp.net Ajax

Good day!

After integrating ajax accordion pane controls in my asp.net app, an exception pops up as stated by the title of the post.

The culprit was that I initialized two AccordionPane objects w/o specifying the ID's of each object.

The solution is to include ID's in each control.See example below:
AccordionPane ap1 = new AccordionPane();  
 ap1.ID = "ap1";  
 ap1.HeaderContainer.Controls.Add(new LiteralControl("Product Code"));  
 ap1.ContentContainer.Controls.Add(new LiteralControl(datarow["ID"].ToString();));  

 AccordionPane ap2 = new AccordionPane();  
 ap2.ID = "ap2";  
 ap2.HeaderContainer.Controls.Add(new LiteralControl("Product Name"));  
 ap2.ContentContainer.Controls.Add(new LiteralControl(datarow["Prod_Name"].ToString();))

Cheers!

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input