By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,586 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,586 IT Pros & Developers. It's quick & easy.

making a table invisible

P: n/a
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
Oct 13 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
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...
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

Oct 13 '06 #2

P: n/a
"Carlos" <ch******@yahoo.comwrote in message
news:O0*************@TK2MSFTNGP05.phx.gbl...
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 ?
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...
Oct 13 '06 #3

P: n/a
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.comwrote in message
news:O0*************@TK2MSFTNGP05.phx.gbl...
>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 ?

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...

Oct 13 '06 #4

P: n/a
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:eo*************@TK2MSFTNGP05.phx.gbl...
it always worked for me, and I have a lot of web pages with that :-)
Well good for you!

It doesn't alter the fact that setting a control's server-side Visible
property to false prevents that control from even being rendered to the
browser.

No doubt to you this looks as if you've hidden the control, but it's not the
same thing at all...
Oct 13 '06 #5

P: n/a
well, my propose is not to render at all, that's the visible = false mean...
if I wnat to colapse I use Atlas for 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:uO**************@TK2MSFTNGP03.phx.gbl...
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:eo*************@TK2MSFTNGP05.phx.gbl...
>it always worked for me, and I have a lot of web pages with that :-)

Well good for you!

It doesn't alter the fact that setting a control's server-side Visible
property to false prevents that control from even being rendered to the
browser.

No doubt to you this looks as if you've hidden the control, but it's not
the same thing at all...

Oct 13 '06 #6

P: n/a
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:OB**************@TK2MSFTNGP04.phx.gbl...
if I wnat to colapse I use Atlas for that ;-)
http://www.sitepoint.com/blogs/2006/...owser-support/
Oct 13 '06 #7

P: n/a
you right, but the I use Firefox and I still didn't have any trouble using
it (I'm only using the basics, update panel, updateprogress, etc, nothing
fancy)

--

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:uQ**************@TK2MSFTNGP04.phx.gbl...
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:OB**************@TK2MSFTNGP04.phx.gbl...
>if I wnat to colapse I use Atlas for that ;-)

http://www.sitepoint.com/blogs/2006/...owser-support/

Oct 13 '06 #8

P: n/a
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
you right, but the I use Firefox
Oh for heaven's sake!

Do all your clients use FireFox too?

What about the poor unfortunates who use Opera...? Or Safari? Or Konqueror
on Linux?

Who gives a damn about them, right...?
Oct 13 '06 #9

P: n/a
exactly!

"Website available for IE and Firefox"

:-)

--

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:uD**************@TK2MSFTNGP04.phx.gbl...
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>you right, but the I use Firefox

Oh for heaven's sake!

Do all your clients use FireFox too?

What about the poor unfortunates who use Opera...? Or Safari? Or Konqueror
on Linux?

Who gives a damn about them, right...?

Oct 13 '06 #10

P: n/a
"Bruno Alexandre" <br*********@gmail.comwrote in message
news:up**************@TK2MSFTNGP03.phx.gbl...
exactly!

"Website available for IE and Firefox"
Make this guy an MVP now...
Oct 13 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.