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
 

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

Similar Threads

How to hide a text line? 1
Show and Hide 1
Access Textbox - Hide Cursor 0
How to hide table? 2
How to hide a div? 1
Hide and Show Div on Page_Load 3
How to hide this? 2
if function - evaluating 2 cells - help 5

Back
Top