Repeater ItemCommand Won't Fire without ViewState
There's something fishy going on between Repeater ItemCommands and ViewState. I had some asp:LinkButton controls in a HeaderTemplate that just wouldn't fire... until I enabled ViewState for the Repeater control. Once I knew that it had something to do with ViewState, I was able to see that others have run into this.
Odder still, others had experienced the opposite - ItemCommand only fires if ViewState is disabled.
It's easy to Google this up once you know to search on Repeater ItemCommand ViewState, but if you don't know that ViewState's the issue (and why would you?) it's a head scratcher.
Update: Clint Simon set me straight on this one:
“This is because on a postback the linkbutton that is inside your repeater doesn't exist unless you rebind the repeater. If viewstate is off the server can't fire the linkbutton.click event because the linkbutton doesn't exist in the control tree.
You can safely set enableviewstate to false on the repeater if you make sure to rebind the reapeater on each request weather there is a postback or not.”