I'm programmatically adding a ro开发者_Python百科w to a System.Web.UI.WebControls.Table inside an UpdatePanel. I then add cells to the row and controls to the cells.
Once the controls have been added I get Microsoft JScript runtime error:
"Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'txtValue' were found. FindControl requires that controls have unique IDs."
Because the controls are in seperate rows, should then not get their own client IDs, making them unique?
Table doesn't quite work like that. Each row is not a container in the same way it would be in say a GridView. Why would you not simply give them unique names?
Am not sure but try add the control to the page control collection too
this.Controls.Add( txtValue );
精彩评论