Why this does not remove the table from the display

C

Cal Who

I put the code below into Page_Load and then tried Page_PreRender but the
table still shows.

CType(Me.FindControl("FormMaster").FindControl("TableTop"),
System.Web.UI.HtmlControls.HtmlTable).Visible = False

Using the debugger I can see that the FindControls do indeed find the
correct table OK,

Do you know why this does not remove the table from the display?

Thanks
 
G

Gregory A. Beamer

Do you know why this does not remove the table from the display?

Not sure, but one thing that might be the problem is the lack of a
runat=server in the control. Long shot, perhaps.

What I generally do is place the stuff to hide in a Panel. Sure it adds
a bit more HTML, but container controls are really nice for "hiding" as
you can add additional bits into the container later and have them hide
too.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
C

Cal Who

Gregory A. Beamer said:
Not sure, but one thing that might be the problem is the lack of a
runat=server in the control. Long shot, perhaps.

I have that.
What I generally do is place the stuff to hide in a Panel. Sure it adds
a bit more HTML, but container controls are really nice for "hiding" as
you can add additional bits into the container later and have them hide
too.
Maybe I'll try that but since there is only one element it seems I shouldn't
have to add a bit more HTML.

I was looking for something like "visible doesn't work with tables". That
is, maybe there was something basic that I didn't know.

I'll keep plugging along. Somehow these thing always get resolved.

Eventually!

Thanks
 

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

Top