Set Visible property with server tag <%= %> in Framework 3.5

前端 未结 5 1092
礼貌的吻别
礼貌的吻别 2020-12-01 07:16

I have been working in a .NET Framework 4 project using server tags like <%=whatever %> to set the visibility of runat=\"server\" controls, like the following:

         


        
5条回答
  •  天涯浪人
    2020-12-01 07:48

    Another approach is ti give an ID to the control and set the visible in code.

    protected void Page_Load(object sender, EventArgs e){
       MyId.Visible = MyVisiblePropertyOnCodeBehind;
    } 
    
    
    Content

提交回复
热议问题