Access a control inside a the LayoutTemplate of a ListView

后端 未结 5 833
花落未央
花落未央 2020-12-17 09:05

How do I access a Control in the LayoutTemplate of a ListView control?

I need to get to litControlTitle and set its Text

5条回答
  •  不思量自难忘°
    2020-12-17 09:22

    The complete solution:

    
      
        
        
      
      
      
    
    

    In codebehind:

    protected void OnLayoutCreated(object sender, EventArgs e)
    {
        (lv.FindControl("lt_Title") as Literal).Text = "Your text";
    }
    

提交回复
热议问题