简体   繁体   English

如何使用javascript使服务器端的表行可见?

[英]How to make table row at server side visible using javascript?

I am making a tr which runs at server side to invisible. 我正在做一个tr,它在服务器端运行到不可见。 But in some conditions,I want it to be visible.I am using the bellow script to make it visible: 但是在某些情况下,我希望它是可见的。我正在使用波纹管脚本使其可见:

 document.getElementById('trID').style.display = "block"

and also i used: 我也用过:

  document.getElementById('hidebuttons').style.visibility = "visible";

But it is not working. 但这是行不通的。 Please help me on this. 请帮我。

Once control is marked as invisible at server side, no mark-up (html) is emitted for it. 一旦控件在服务器端被标记为不可见,就不会为其发出标记(html)。 So it cannot be made visible at JS, because it (corresponding html) does not exists at client side. 因此它不能在JS上显示,因为它(对应的html)在客户端不存在。

you can do something like 你可以做类似的事情

trID.Attributes.Add("style", "display:none");

then in javascript 然后在JavaScript

document.getElementById('trID').style.display = "block"

NOTE : If you set the control visible=false in server side then it will not render at client side 注意 :如果您在服务器端设置控件visible=false ,那么它将不会在客户端渲染

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM