ASP.NET, VB: how to access controls inside a FormView from the code behind?

前端 未结 3 1887
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 12:06

I have a checkbox and a panel inside of a FormView control, and I need to access them from the code behind in order to use the checkbox to determine whether or not the panel

3条回答
  •  忘掉有多难
    2020-12-30 12:33

    In VB you need use Directcast

    Dim chk As Checkbox = DirectCast(Me.FormView1.FindControl("checkgen"), Checkbox)
    

提交回复
热议问题