0
votes

I searched the web on this topic and got plenty of suggestions from every one (including other stackoverflow threads).

Finally, I thought implement as shown exactly here.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.repeater.onitemcommand(VS.71).aspx

Still frustrated.

My repeater is available in a user control and I added the user control as a web part to an existing webpartzone. I could see all rows in the repeater (along with buttons). Once I click the (any) button, it loses all the rows and itemcommand never fires.

I am using ASP.NET 4.0

Can anyone help me on this.

2
Show uz ze codeh. Like the answer below says, might help if you paste the relevant HTML and CS for the Repeater. - RPM1984

2 Answers

2
votes

Databound list controls (just like any other dynamically-created controls) need to be recreated on postback. Do you have your Databind call within an if (!IsPostback) {} ?

Source code might help determine your specific issue.

-1
votes

All the time, the Repeater has to be bound. Otherwise, Repeater_ItemCommand EVENT of the Repeater won't be fired.

That means:

     if (!IsPostBack)
            {
               BindRepeater();
            }
            else
            {
                BindRepeater();

            }