Nested Repeaters ItemCommand not firing

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

I have a nested repeater situation with a Link Button on the nested
repeater. However when the link button is clicked I get a postback but the
event never takes place.

I'm trying to wire up the nested repeaters ItemCommand event in the
ItemDataBound of the outer repeater. I have even tried sharing the Outer
repeaters ItemCommand event but it still does not fire.

I'm missing a trick here, can you tell me what it is?
 
Josh said:
I have a nested repeater situation with a Link Button on the nested
repeater. However when the link button is clicked I get a postback but the
event never takes place.

I'm trying to wire up the nested repeaters ItemCommand event in the
ItemDataBound of the outer repeater. I have even tried sharing the Outer
repeaters ItemCommand event but it still does not fire.

I'm missing a trick here, can you tell me what it is?

Usually, this type of problem is caused by the link button having a
different ID before and after the postback, in case of which its events will
not fire.
Possibly, some controls are added or removed during the postback, which
might cause this id shift.

To check whether indeed this is the case, set Trace=True in the page
directive, and check the control tree to see if the link button's id is the
same.
Maybe this will lead you to a solution.

It's a common problem with dynamically created controls.

Riki
 
And you don't accidentally bind in Page_Load without IsPostBack check?
Databinding on every request is common reason for event issues with
databound controls.
 
Back
Top