如何使用C#编码隐藏表中的td [英] How to hide a td in a table by using C# coding
本文介绍了如何使用C#编码隐藏表中的td的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨..如何通过编程方式识别我的下面的td,而不是使用java脚本函数..
Hi.. How to id my below td by programatically, not using java script function..
<td align="right" id="tdDOR" runat="server">
DOR
</td>
我在谷歌搜索过但我没有得到正确的解决方案..
Tha nks&此致,
亲爱的........
I searched in google also but I didn''t get the right solution..
Thanks & Regards,
Honey........
推荐答案
由于您在服务器上有TD可用,因此设置runat =server
并且不想使用Javascript,在Page_Load
事件中通过其ID访问td并设置它visible = false
ie
Since you have the TD available on server, by settingrunat="server"
and do not want to use Javascript, on thePage_Load
event access the td by its ID and set itvisible = false
i.e.,
tdDOR.visible = false
或
你也可以设置它的风格HTML本身
or
You can set its style as well in HTML itself
<td align="right" id="tdDOR" runat="server" style="display:none">
DOR
</td>
或
您也可以在Page_Load事件后面的代码中设置此样式
or
You can set this style in code behind as well on Page_Load event
tdDOR.attributes.add("style","display:none")
或
你可以使用另一种风格,
Or
You can use another style,
tdDOR.attributes.add("style","visibility:hidden")
试试这个
tdDOR.Visible = false;
Hi,
try this
tdDOR.Visible = false;
这篇关于如何使用C#编码隐藏表中的td的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文