使桌子看不见 [英] making a table invisible

查看:78
本文介绍了使桌子看不见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一张桌子,我想让它变得不可靠,这取决于检索到的数据的有效性。问题是在

背后的代码中,对表的引用不被理解。 (即它表示我没有声明我用它的ID引用的

html控件)。我怎么能够b / b
参考它,

并让它隐形?


提前致谢,

Carlos

Hi all,

I have a table that I would like to make it invsible depending on the
validity of data retrieved. The problem is that within the code behind
the reference to the table is not understood. (i.e. it says that the
html control that I reference with its ID is not declared). How can I
reference it,
and make it invisible ?

Thanks in advance,

Carlos

推荐答案

html代码


< table id =" myTable" RUNAT = QUOT;服务器" CELLPADDING = QUOT; 0" ...>

vb代码:


myTable.visible = False



myTable.visible = True


-


Bruno Alexandre

K?benhavn,Danmark


丹麦的葡萄牙语


Blog。 http://balexandre.blogspot.com/

照片。 http://www.flickr.com/photos/balexandre/

" Carlos" < ch ****** @ yahoo.com在留言中写道

新闻:O0 ************* @ TK2MSFTNGP05.phx.gbl ...
html code

<table id="myTable" runat="server" cellpadding="0" ... >
vb code:

myTable.visible = False
or
myTable.visible = True

--

Bruno Alexandre
K?benhavn, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"Carlos" <ch******@yahoo.comwrote in message
news:O0*************@TK2MSFTNGP05.phx.gbl...

大家好,


我有一张桌子,我想让它变得不可靠取决于

检索数据的有效性。问题是在

背后的代码中,对表的引用不被理解。 (即它表示我没有声明我用它的ID引用的

html控件)。我怎么能够b / b
参考它,

并让它隐形?


提前致谢,

Carlos
Hi all,

I have a table that I would like to make it invsible depending on the
validity of data retrieved. The problem is that within the code behind
the reference to the table is not understood. (i.e. it says that the
html control that I reference with its ID is not declared). How can I
reference it,
and make it invisible ?

Thanks in advance,

Carlos



" Carlos" < ch ****** @ yahoo.com在留言中写道

新闻:O0 ************* @ TK2MSFTNGP05.phx.gbl ...
"Carlos" <ch******@yahoo.comwrote in message
news:O0*************@TK2MSFTNGP05.phx.gbl...

我有一个表,我想让它变得不可靠,这取决于检索到的数据的有效性。问题是在

背后的代码中,对表的引用不被理解。 (即它表示我没有声明我用它的ID引用的

html控件)。我怎么能够b / b
引用它,并让它隐形?
I have a table that I would like to make it invsible depending on the
validity of data retrieved. The problem is that within the code behind
the reference to the table is not understood. (i.e. it says that the
html control that I reference with its ID is not declared). How can I
reference it, and make it invisible ?



不要在代码隐藏中设置表的可见属性!这不会隐藏

表 - 它会阻止它呈现给浏览器。


相反,你需要在客户端设置其可见性风格 - 支持JavaScript,如下所示:


document.getElementById("< tableID>")。s​​tyle.display =" none" ;; < br $>




document.getElementById("< tableID>")。s​​tyle.display =" block";


让它再次可见。


请注意,有些浏览器不了解显示风格,所以

您可能需要使用可见性样式 - 有大量关于此的Google

文章...

DO NOT set the table''s Visible property in code-behind! That will not hide
the 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";

or

document.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 of Google
articles 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 Alexandre
K?benhavn, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:OC****************@TK2MSFTNGP03.phx.gbl...

" Carlos" < ch ****** @ yahoo.com在留言中写道

新闻:O0 ************* @ TK2MSFTNGP05.phx.gbl ...
"Carlos" <ch******@yahoo.comwrote in message
news:O0*************@TK2MSFTNGP05.phx.gbl...

>我有一个表格,我想让它变得不可靠,具体取决于检索数据的有效性。问题是在
背后的代码中,对表的引用不被理解。 (即它表示我没有声明我用它的ID引用的HTML控件)。我怎样才能引用它,让它隐形?
>I have a table that I would like to make it invsible depending on the
validity of data retrieved. The problem is that within the code behind
the reference to the table is not understood. (i.e. it says that the
html control that I reference with its ID is not declared). How can I
reference it, and make it invisible ?



不要在代码隐藏中设置表的可见属性!这不会隐藏

表 - 它会阻止它呈现给浏览器。


相反,你需要在客户端设置其可见性风格 - 一边JavaScript,

如下:


document.getElementById("< tableID>")。s​​tyle.display =" none" ;; < br $>




document.getElementById("< tableID>")。s​​tyle.display =" block";


让它再次可见。


请注意,有些浏览器不了解显示风格,

所以你可能需要使用可见性样式 - 有大量的

关于此的Google文章...


DO NOT set the table''s Visible property in code-behind! That will not hide
the 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";

or

document.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 of
Google articles about this...



这篇关于使桌子看不见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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