在运行时隐藏表的列 [英] Hiding Columns of an table at runtime

查看:59
本文介绍了在运行时隐藏表的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Coders,
我遇到了一个问题,我必须根据某些条件在运行时隐藏表的某些列.
预先感谢!

示例如下:

Hello Coders,
I had got an problem, I have to hide certain columns of a table during run-time on basis of some conditions.
Thanks in advance !

Example as follows:

<b>Testpage.aspx</b>
<table>
  <tr>
    <td id = "one"> Hello</td>
  </tr>
</table>


在页面加载事件中,我想隐藏此< td>在某些情况下.


On page load event I want to hide this <td> on some conditions.

推荐答案

请参阅以下代码.

Refer following code.

<b>Testpage.aspx</b>
<table>
  <tr>
<![CDATA[<%
     if (Convert.ToInt32(Session["usertype"]) != 1)
     { 
          %>]]>
    <td id = "one"> Hello</td>
<![CDATA[<%}%>]]>
  </tr>
</table>


这篇关于在运行时隐藏表的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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