Show / Hide Text

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
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
 
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.
 
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)
 
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
 
Back
Top