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

前端 未结 5 1084
礼貌的吻别
礼貌的吻别 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:37

    Here is another approach which maintains the simplicity of the code from your original question. Here you would have to remove the runat="server" from the div tag and use css "display:none" instead of the "Visible" property. The downside to this approach is that the tag still gets sent to the browser even if it is not visible and the visibility is handled on the client side.

    Content

提交回复
热议问题