如何隐藏code(C#)一个div [英] How to hide a div from code (c#)

查看:109
本文介绍了如何隐藏code(C#)一个div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有希望显示基于会话值/隐藏在我的code,后面我的网页上div元素。我怎样才能做到这一点?

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?

推荐答案

给股利=服务器 ID 键,你可以参考它的 code后面

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

<div runat="server" id="theDiv">

在code背后:

{
    theDiv.Visible = false;
}

这篇关于如何隐藏code(C#)一个div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆