I have a composite user control with dynamically created text boxes. As the text boxes are created and inserted into a placeholder on the ASCX, I'm also dynamically creating a AutoCompleteExtender, targeting the text box just created. Everything works fine if I only add a single ACE, but as soon as more than one are present on the page, I get the following error:
Microsoft JScript runtime error: Unable to get value of the property '_behaviors': object is null or undefined
This is the specific location of the JScript error, contained within jQuery.
var c=a._behaviors=a._behaviors||[];
The same code works if I create dummy text boxes and ACE's on my page. But I need these created in the custom control.
That indicates I'm "doing it right" - also, since I can get ONE ACE working in the control just fine.
I'm using a web service - NOT a page method - I realize user and custom controls cannot contain page methods, those must be in a "page."
I've tried a number of things - I've ensured the text boxes all have unique ID's. The ACE's all have unique ID's. I've tried with and without the BehaviorID on the ACE defined (again with a unique ID). I know the web service works because a single ACE runs great.
I've even tried passing a list of the generated ACE's up to the page level from the control, and inserting them into a page-level placeholder. Then I get RTE's that the textbox could not be found with the ID provided.
Any tips for adding multiple ACE's in a composite user control, with dynamically generated text boxes and extenders?
Regards.