Show / Hide Text

M

Miguel Dias Moura

Hello,

I have 2 tables in a web page.

I want to show first table and hide second when the URL parameter
result=ok.
And of course the oposite when result=notok.

How to do this?

Thanks,
Miguel
 
K

Ken Dopierala Jr.

Hi Miguel,

Create your table tags with the following attributes:

<table runat="server" id="tblMyTable">

In your code behind have this declaration:

Protected WithEvents tblMyTable As System.Web.UI.HtmlControls.HtmlTable

Then to hide the table put this in your code:

tblMyTable.Visible = False

Good luck! Ken.
 
H

Hermit Dave

add the tables to individual panels (having given the panels a unique name.)
check for result parameter using
Request("result") or Request["result"]
if the value is "ok" then set the visible property of corresponding panel to
true and the other panel to false
and the otherway around if it "notok"
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 
G

Guest

A few ways:

1. Put each table on a "panel" control, e.g. Panel1 and Panel2, then set
..visible of each to true/false.

2. Use user controls, and do the same thing with .visible.

3. Set "id=" and "runat=server" on each of the <table> tags, then again set
..visible for the table controls (the first two ways are much cleaner).

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top