473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Hide Table with OnClick

Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that? I'm not
showing an ID when I create a table so how do I tell it to hide it? Is
there a way to add an ID to a table? If so, how do you hide it. Please
give it to me in a format like you would for a Label (label1.visible =
False)

Thanks in advance

Phil
Jul 11 '06 #1
10 2953
<script runat="server" language="C#">

protected void Button1_Click(object sender, EventArgs e)
{
table1.Visibile = false;
}

</script>

<table id="table1" runat="server"></table>
<asp:button id="Button1" runat="server" onclick="Button1_Click" />

Phillip Vong wrote:
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that? I'm not
showing an ID when I create a table so how do I tell it to hide it? Is
there a way to add an ID to a table? If so, how do you hide it. Please
give it to me in a format like you would for a Label (label1.visible =
False)

Thanks in advance

Phil
Jul 11 '06 #2


"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:ub**************@TK2MSFTNGP03.phx.gbl...
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that? I'm
not showing an ID when I create a table so how do I tell it to hide it?
Is there a way to add an ID to a table? If so, how do you hide it.
Please give it to me in a format like you would for a Label
(label1.visible = False)
If you want to do it with a server side click event go with:

<table id=table1 runat=server>

then just do:
table1.visible = false


Jul 11 '06 #3
or do you mean when the table itself is clicked?


Aemca wrote:
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:ub**************@TK2MSFTNGP03.phx.gbl...
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that? I'm
not showing an ID when I create a table so how do I tell it to hide it?
Is there a way to add an ID to a table? If so, how do you hide it.
Please give it to me in a format like you would for a Label
(label1.visible = False)

If you want to do it with a server side click event go with:

<table id=table1 runat=server>

then just do:
table1.visible = false
Jul 11 '06 #4
Anyone other novices do like I did and start with, "Sure, that should
be easy enough by just adding an ID and then an event
handl....wait...huh."

You can add an id to the table with the typical id="Table1" attribute
and even add an OnClick event handler with OnClick="Table1_Click", but
I don't see how to make the table accessible from the Table1_Click
event code. I'm guessing there is something different about dealing
with containers, maybe? I find it odd that OnClick is aparently
appropriate for a table, yet not implemented the same as other
clickable controls.

Rich
Phillip Vong wrote:
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that? I'm not
showing an ID when I create a table so how do I tell it to hide it? Is
there a way to add an ID to a table? If so, how do you hide it. Please
give it to me in a format like you would for a Label (label1.visible =
False)

Thanks in advance

Phil
Jul 11 '06 #5
Thanks for the reply. I've already tried that and it's telling me table1 is
not defined.
<ne**********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
<script runat="server" language="C#">

protected void Button1_Click(object sender, EventArgs e)
{
table1.Visibile = false;
}

</script>

<table id="table1" runat="server"></table>
<asp:button id="Button1" runat="server" onclick="Button1_Click" />

Phillip Vong wrote:
>Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that? I'm
not
showing an ID when I create a table so how do I tell it to hide it? Is
there a way to add an ID to a table? If so, how do you hide it. Please
give it to me in a format like you would for a Label (label1.visible =
False)

Thanks in advance

Phil

Jul 11 '06 #6
Doh! runat="server" fixed the problem of it not being visible in the
Table1_Click event, but now I get a "Table1_Click has not been defined"
error on the page, even though that *is* the name of the procedure I
created.

Rich

Richard Carpenter wrote:
Anyone other novices do like I did and start with, "Sure, that should
be easy enough by just adding an ID and then an event
handl....wait...huh."

You can add an id to the table with the typical id="Table1" attribute
and even add an OnClick event handler with OnClick="Table1_Click", but
I don't see how to make the table accessible from the Table1_Click
event code. I'm guessing there is something different about dealing
with containers, maybe? I find it odd that OnClick is aparently
appropriate for a table, yet not implemented the same as other
clickable controls.

Rich
Phillip Vong wrote:
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that? I'm not
showing an ID when I create a table so how do I tell it to hide it? Is
there a way to add an ID to a table? If so, how do you hide it. Please
give it to me in a format like you would for a Label (label1.visible =
False)

Thanks in advance

Phil
Jul 11 '06 #7
I'm not talking about clicking the table. Just the button. When I give the
<table id=table1 runat=serverand I try table1.visible = false

It tells me table1 is not defined. Maybe I forgot to mention that I'm using
VS2005 in MasterPage and the table is in one of the contents.
<ne**********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
or do you mean when the table itself is clicked?


Aemca wrote:
>"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:ub**************@TK2MSFTNGP03.phx.gbl...
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that?
I'm
not showing an ID when I create a table so how do I tell it to hide it?
Is there a way to add an ID to a table? If so, how do you hide it.
Please give it to me in a format like you would for a Label
(label1.visible = False)

If you want to do it with a server side click event go with:

<table id=table1 runat=server>

then just do:
table1.visible = false

Jul 11 '06 #8
are you trying to hide it in the masterpage or in the content page?
Phillip Vong wrote:
I'm not talking about clicking the table. Just the button. When I give the
<table id=table1 runat=serverand I try table1.visible = false

It tells me table1 is not defined. Maybe I forgot to mention that I'm using
VS2005 in MasterPage and the table is in one of the contents.
<ne**********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
or do you mean when the table itself is clicked?


Aemca wrote:
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:ub**************@TK2MSFTNGP03.phx.gbl...
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that?
I'm
not showing an ID when I create a table so how do I tell it to hide it?
Is there a way to add an ID to a table? If so, how do you hide it.
Please give it to me in a format like you would for a Label
(label1.visible = False)

If you want to do it with a server side click event go with:

<table id=table1 runat=server>

then just do:
table1.visible = false
Jul 11 '06 #9
you could also hide it on the client side:

<table onclick=" this.style.display = 'none' ; ">

cheers

neil
Phillip Vong wrote:
I'm not talking about clicking the table. Just the button. When I give the
<table id=table1 runat=serverand I try table1.visible = false

It tells me table1 is not defined. Maybe I forgot to mention that I'm using
VS2005 in MasterPage and the table is in one of the contents.
<ne**********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
or do you mean when the table itself is clicked?


Aemca wrote:
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:ub**************@TK2MSFTNGP03.phx.gbl...
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that?
I'm
not showing an ID when I create a table so how do I tell it to hide it?
Is there a way to add an ID to a table? If so, how do you hide it.
Please give it to me in a format like you would for a Label
(label1.visible = False)

If you want to do it with a server side click event go with:

<table id=table1 runat=server>

then just do:
table1.visible = false
Jul 11 '06 #10
The table is in the CONTENT and I would like to do it from the server side.
Thanks!
<ne**********@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
you could also hide it on the client side:

<table onclick=" this.style.display = 'none' ; ">

cheers

neil
Phillip Vong wrote:
>I'm not talking about clicking the table. Just the button. When I give
the
<table id=table1 runat=serverand I try table1.visible = false

It tells me table1 is not defined. Maybe I forgot to mention that I'm
using
VS2005 in MasterPage and the table is in one of the contents.
<ne**********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegr oups.com...
or do you mean when the table itself is clicked?


Aemca wrote:
"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:ub**************@TK2MSFTNGP03.phx.gbl...
Newbie here on ASP.NET

I want to hide a Table with and OnClick event. How do you do that?
I'm
not showing an ID when I create a table so how do I tell it to hide
it?
Is there a way to add an ID to a table? If so, how do you hide it.
Please give it to me in a format like you would for a Label
(label1.visible = False)

If you want to do it with a server side click event go with:

<table id=table1 runat=server>

then just do:
table1.visible = false

Jul 11 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Michael Skind | last post by:
Hello, I use a simple Table : <TABLE> <TR 1> <TD></TD> </TR> <TR 2> <TD></TD> </TR>
7
by: Mad Scientist Jr | last post by:
Through messing around I got IE6 (win xp) to show/hide a table row. I gave my <TR> an ID of "trRow" and trRow.style.display='none'; hides it trRow.style.display='block'; displays it (will any...
5
by: Zambien | last post by:
Hi all, Here's my problem. I have tables that are using the menu/submenu idea for hiding rows. This works fine in IE (of course) and does show/hide correctly in netscape, but as soon as the...
10
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
2
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
6
by: michael941 | last post by:
Hi, I have 2 tables in an html page. I have div them separately and id them as id1 and id2. I have a link there. What I need is click the link to hide one table and show the other and verse when...
5
by: Dautkhanov | last post by:
Hello all ! I have my own library for web-design building - active forms, lists. I am going to build tabbing component. The complexity in this process is that all web forms uniformed and are...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
1
by: filch | last post by:
Hi, I am new to this forum ... so hello to all! I am trying to get a script working which will show or hide a table based on a user checking or unchecking a parent checkbox. This is the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.