Control content setting method in Repeater FooterTemplate

  • 2020-05-07 19:28:57
  • OfStack

There is no FindControl method for FooterTemplate in Repeater, and FooterTemplate cannot be converted to RepeaterItem, although in ItemDataBound event of Repeater, RepeaterItemEventArgs parameter can be identified by if (e.Item.ItemType == ListItemType.Footer), but not at other times.

The methods found so far are as follows:


((Literal)rep2.Controls[rep2.Controls.Count - 1].FindControl("rep2Sum")).Text = ss.ToString(); 


I put an Literal in FooterTemplate.
That is, FooterTemplate is the last control in the Repeater control.

Related articles: