Click to See Complete Forum and Search --> : Itemplates & Childcontrol eventhandlers


Metaphor
November 12th, 2004, 05:42 AM
Right.

* I've got an ITemplate in a server-control.
* I instatiate the ITemplate in a tablecell in my server-control's controltree in CreateChildControls.
* I declare childcontrols of that template in the .aspx-page using the server-control.
* I add an eventhandler to the childcontrol using, for example, OnSelectedIndexChanged="onChange" in the tag.
* I add the code for the eventhandler in the codebehind of the .aspx-page.

The problem is, the event isn't firing. Help, please?

mmetzger
November 12th, 2004, 11:55 AM
Do you have AutoPostBack set to true? This would be required if you're changing the selected index in a webform and expect the page to automatically update. Depending on the operation you're performing, you might want to rearchitect your page to use client side scripting for this action.

Post some code if you can, it will help verify the issue.

Metaphor
November 12th, 2004, 02:50 PM
Yes, autopostback is set to true, naturally. The proper javascript __dopostback is rendered, but the event isn't connected properly to the control.

Metaphor
November 24th, 2004, 04:20 PM
Noone with experience enough to give my problem a go? :)