Find Control Inside ListView Control

前端 未结 5 1169
有刺的猬
有刺的猬 2020-12-19 08:06

I want to find \"Label\" control with ID = \"Label\" inside the \"ListView\" control. I was trying to do this with the following code:

((Label)this.ChatListV         


        
5条回答
  •  眼角桃花
    2020-12-19 08:48

    It should be Label1 in the arguement:

     ((Label)this.ChatListView.FindControl("Label1")).Text = "active";
    

    This should be in a databound event.

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listview.itemdatabound.aspx

提交回复
热议问题