asp.net - 在代码隐藏中使用 vb.net 在表中隐藏 tr 或 td

标签 asp.net vb.net

在我的母版页中,我有用户链接,授权也不同,如管理员和普通用户。

彼此下的链接,我可以根据授权状态隐藏超链接,但问题是,当我有 3 个链接时,管理员的第二个链接将在用户正常且链接位置为空时隐藏,如 123 1 3.

所以我有一个想法,在一个 tr 中使用表中的每个链接,但我无法隐藏 td 或 tr,因为 Visible 不在属性中。

有什么帮助吗? 谢谢

最佳答案

根据how to hide a having asp.net control :

you can give ID either to the TD or TR to which you want to hide/show with the runat="server" and also you can take that tr/td inside the div tag and give id to that div tag and also runat=server attribute and after that you can pro grammatically hide/show that div.

like

<pre>

<tr id="trhide" runat="server"> </tr>

</pre> 

in code behind write

trhide.visible=true/false

关于asp.net - 在代码隐藏中使用 vb.net 在表中隐藏 tr 或 td,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21214351/

相关文章:

c# - 在 Winforms 和 .net 中难以在设计时保留引用内部属性的集合

c# - Asp .NET 从 tar.gz 存档中读取文件

javascript - 在 asp.net 中调用 javascript/jquery 函数

ASP.net 从 Google 重定向到移动网站

.net - VB.Net 序列化和反序列化私有(private)成员 - 简单示例

c# - 如何在解决方案资源管理器中隐藏 bin 和 obj 文件夹

c# - WebResource.axd 和 ScriptResource.axd 加载非常慢

c# - 对于 Int32 值太大或太小

C# 有更好的写法吗?

asp.net - System.Configuration.ConfigurationSection 在类库下不可用