使桌子看不见

扫码查看
CarlosHi all,I have a table that I would like to make it invsible depending on thevalidity of data retrieved. The problem is that within the code behindthe reference to the table is not understood. (i.e. it says that thehtml control that I reference with its ID is not declared). How can Ireference it,and make it invisible ?Thanks in advance, Carlos" Carlos" < ch ****** @ yahoo.com在留言中写道 新闻:O0 ************* @ TK2MSFTNGP05.phx.gbl ..."Carlos" <ch******@yahoo.comwrote in messagenews:O0*************@TK2MSFTNGP05.phx.gbl... 我有一个表,我想让它变得不可靠,这取决于检索到的数据的有效性。问题是在 背后的代码中,对表的引用不被理解。 (即它表示我没有声明我用它的ID引用的 html控件)。我怎么能够b / b 引用它,并让它隐形?I have a table that I would like to make it invsible depending on thevalidity of data retrieved. The problem is that within the code behindthe reference to the table is not understood. (i.e. it says that thehtml control that I reference with its ID is not declared). How can Ireference it, and make it invisible ? 不要在代码隐藏中设置表的可见属性!这不会隐藏 表 - 它会阻止它呈现给浏览器。 相反,你需要在客户端设置其可见性风格 - 支持JavaScript,如下所示: document.getElementById("< tableID>")。s​​tyle.display =" none" ;; 或 document.getElementById("< tableID>")。s​​tyle.display =" block"; 让它再次可见。 请注意,有些浏览器不了解显示风格,所以 您可能需要使用可见性样式 - 有大量关于此的Google 文章...DO NOT set the table''s Visible property in code-behind! That will not hidethe table - it will stop it even being rendered to the browser.Instead, you need to set its visibility style in client-side JavaScript, asfollows:document.getElementById("<tableID>").style.display ="none";ordocument.getElementById("<tableID>").style.display ="block";to make it visible again.Be aware, though, that some browsers don''t understand the display style, soyou may need to use the visibility style instead - there are loads of Googlearticles about this...它始终有效对我来说,我有很多网页:-) - Bruno Alexandre K?benhavn,Danmark 丹麦的葡萄牙语 博客。 http://balexandre.blogspot.com/ 照片。 http://www.flickr.com/photos/balexandre/ " Mark Rae" < ma ** @ markNOSPAMrae.com写信息 新闻:OC **************** @ TK2MSFTNGP03.phx.gbl ...it always worked for me, and I have a lot of web pages with that :-)--Bruno AlexandreK?benhavn, Danmark"a Portuguese in Denmark"Blog. http://balexandre.blogspot.com/Photos. http://www.flickr.com/photos/balexandre/"Mark Rae" <ma**@markNOSPAMrae.comwrote in messagenews:OC****************@TK2MSFTNGP03.phx.gbl... " Carlos" < ch ****** @ yahoo.com在留言中写道 新闻:O0 ************* @ TK2MSFTNGP05.phx.gbl ..."Carlos" <ch******@yahoo.comwrote in messagenews:O0*************@TK2MSFTNGP05.phx.gbl... >我有一个表格,我想让它变得不可靠,具体取决于检索数据的有效性。问题是在背后的代码中,对表的引用不被理解。 (即它表示我没有声明我用它的ID引用的HTML控件)。我怎样才能引用它,让它隐形?>I have a table that I would like to make it invsible depending on thevalidity of data retrieved. The problem is that within the code behindthe reference to the table is not understood. (i.e. it says that thehtml control that I reference with its ID is not declared). How can Ireference it, and make it invisible ? 不要在代码隐藏中设置表的可见属性!这不会隐藏 表 - 它会阻止它呈现给浏览器。 相反,你需要在客户端设置其可见性风格 - 一边JavaScript, 如下: document.getElementById("< tableID>")。s​​tyle.display =" none" ;; 或 document.getElementById("< tableID>")。s​​tyle.display =" block"; 让它再次可见。 请注意,有些浏览器不了解显示风格, 所以你可能需要使用可见性样式 - 有大量的 关于此的Google文章...DO NOT set the table''s Visible property in code-behind! That will not hidethe table - it will stop it even being rendered to the browser.Instead, you need to set its visibility style in client-side JavaScript,as follows:document.getElementById("<tableID>").style.display ="none";ordocument.getElementById("<tableID>").style.display ="block";to make it visible again.Be aware, though, that some browsers don''t understand the display style,so you may need to use the visibility style instead - there are loads ofGoogle articles about this... 这篇关于使桌子看不见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-02 22:38
查看更多