Nested Repeaters ItemCommand not firing

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?
 
R

Riki

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
 
T

Teemu Keiski

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top