Can I hide a <TABLE>?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
In my app I have used HTML tables to aid with the layout of the site. i want
some tables only to be viewed by some roles.
e.g. I have a table called tblAdmin, but when I reference this table in code
(to make it visible) I get
"the type or namespace name 'tblAdmin' could not be found..."

Does this mean that I cannot use HTML TABLE's for what I'm doing? i.e. make
them visible or not programatically

Many thanks.
Andy
 
If you have declared it with runat="server" attribute, you can access it and
change visibility from server-side code.

<table id="Table1" runat="server">
....
</table>

'Code to set visibility (e.g is the control rendered)
Table1.Visible = False
 
Andy said:
Hi,
In my app I have used HTML tables to aid with the layout of the site. i want
some tables only to be viewed by some roles.
e.g. I have a table called tblAdmin, but when I reference this table in code
(to make it visible) I get
"the type or namespace name 'tblAdmin' could not be found..."

Does this mean that I cannot use HTML TABLE's for what I'm doing? i.e. make
them visible or not programatically

Many thanks.
Andy

I take it that the table has an ID "tblAdmin"? Then you are halfway
there: Add a "runat='server'" as well. If you then switch to designmode
and back, the declaration is added to the codebehind.
 
Back
Top