Search code examples
c#webformshtml-tablecode-behindvisible

Making non-asp table invisible in behind-code


I'm working with code someone else has written that I cannot change too much for now.

It has a table defined in the html, something like this:

<table id="tblResult">
   some stuff defined in here.
</table>

I would like to use the behind code to make this table and all its contents invisible, but I notice I can't address the table directly as tblResult.visible in the code behind. This makes sense to me, since this is not an asp object. Simply changing this to an asp:table doesn't work, as there's some stuff going on inside that table I prefer not to mess with. Is it possible to address that table and set visibility to false from the behindcode?


Solution

  • Wrap it into a <asp:PlaceHolder> amd then toggle the placeholder visibility.