How to hide a div from code (c#)

前端 未结 9 1643
迷失自我
迷失自我 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 03:51

    if your div has the runat set to server, you surely can do a myDiv.Visible = false in your Page_PreRender event for example.

    if you need help on using the session, have a look in msdn, it's very easy.

提交回复
热议问题