Repeater 的 OnItemDataBound 事件

.aspx 

<asp:Repeater ID="RepeaterSite" runat="server" OnItemDataBound="RepeaterSite_ItemCommand">

</asp:Repeater>

 

.aspx.cs

protected void RepeaterSite_ItemCommand(object source, RepeaterItemEventArgs e)
{
  if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.SelectedItem)
  {
    double ndljsjl = Convert.ToDouble((e.Item.FindControl("txtndljsjl") as TextBox).Text);

  }

}

 

posted @ 2018-04-11 14:09  浅兰色_hy  阅读(344)  评论(0编辑  收藏  举报