How to hide a div from code (c#)

前端 未结 9 1674
迷失自我
迷失自我 2020-12-01 03:38

I have a div element on my page that I wish to show/hide based on a session value in my code-behind. How can I do this?

9条回答
  •  被撕碎了的回忆
    2020-12-01 04:12

    Give the div "runat="server" and an id and you can reference it in your code behind.

    In code behind:

    {
        theDiv.Visible = false;
    }
    

提交回复
热议问题