473,569 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2966
<script runat="server" language="C#">

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

</script>

<table id="table1" runat="server"> </table>
<asp:button id="Button1" runat="server" onclick="Button 1_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*a t*yahoo*dot*com wrote in message
news:ub******** ******@TK2MSFTN GP03.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*a t*yahoo*dot*com wrote in message
news:ub******** ******@TK2MSFTN GP03.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**********@g mail.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
<script runat="server" language="C#">

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

</script>

<table id="table1" runat="server"> </table>
<asp:button id="Button1" runat="server" onclick="Button 1_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_Cli ck 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**********@g mail.comwrote in message
news:11******** **************@ 35g2000cwc.goog legroups.com...
or do you mean when the table itself is clicked?


Aemca wrote:
>"Phillip Vong" <phillip_vong*a t*yahoo*dot*com wrote in message
news:ub******* *******@TK2MSFT NGP03.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.visib le = 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**********@g mail.comwrote in message
news:11******** **************@ 35g2000cwc.goog legroups.com...
or do you mean when the table itself is clicked?


Aemca wrote:
"Phillip Vong" <phillip_vong*a t*yahoo*dot*com wrote in message
news:ub******** ******@TK2MSFTN GP03.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.disp lay = '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**********@g mail.comwrote in message
news:11******** **************@ 35g2000cwc.goog legroups.com...
or do you mean when the table itself is clicked?


Aemca wrote:
"Phillip Vong" <phillip_vong*a t*yahoo*dot*com wrote in message
news:ub******** ******@TK2MSFTN GP03.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

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

Similar topics

18
2267
by: Michael Skind | last post by:
Hello, I use a simple Table : <TABLE> <TR 1> <TD></TD> </TR> <TR 2> <TD></TD> </TR>
7
4127
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 value other than 'none' display on IE6?) I tried enclosing the <TR></TR> inside a <DIV> tag, and hiding that, but it doesn't work for some reason.
5
2168
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 shown method is called, the table gets skewed and the presentation of the data on the page goes horribly wrong. I don't think this is a table issue...
10
4636
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 with the javascript in a toggle fashion. the problem is a know very little javascript and have become incredibly frustrated because i went ahead...
2
12179
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 { display: none; }
6
1986
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 click the link again. I tried many ways in javascript but failed. Could someone please help? Thanks a lot!
5
2130
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 built as TABLEs, where each field is TR. Tabs have to show/hide some of table rows. I don't know how TR's properties must be changed in order to...
1
4155
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. I don`t want to change the way i have used to show and hide layers. check down code :- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
1
1606
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 script I have come up with so far (note that one of my issues is whether or not you can use an if/else construct inside of a case statement): function...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.