Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

My Repeater/DataList/DataGrid events aren firing. Whats wrong?

0
Posted

My Repeater/DataList/DataGrid events aren firing. Whats wrong?

0

A common error is to always databind the content in the PageLoad. If you do so for PostBacks you will be recreating the child controls from the datasource and will lose any ties to the events that are encoded in the request. Just make DataBinding conditional on the IsPostBack property not being true. That will preserve the viewstate and so the ties for the encoded event that will be fired later in the page processing.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123