简体   繁体   中英

Skip ItemDataBound event of the repeater

Is there a way I can skip ItemDataBound event of the repeater like using e.Handled = true inside the event. I know RepeaterItemEventArgs does not contain a Handled property.

Actually I want to bind repeater inside a datalist's databound event due to which repeater's bound event is called twice. So on second call of the ItemDataBound event I want to skip the event.

Store a boolean flag which will have a default value of true and inside your event you should have something like this:

if (myFlag) {
myFlag = false;
//Content of the method
}
else myFlag = true;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM