ASP.NET: How To Hide Table Rows In An HTML Table
While I am absolutely an advocate of table-less design, tables are still useful when used correctly. For instance, it is correct to use a table to display tabular data, or to show a form. I came across this extremely simple, but not well-known way to show and hide HTML table rows via the server. Say you have a table:
<table>
<tr>
<td>Hello, World!</td>
<tr>
<tr>
<td>Goodbye, World!</td>
<tr>
</table>
If you want to be able to control your rows on the backend, simply make your <tr> a server tag! I know this seems simple, but at first to me, it appeared counter-intuitive. To do this, change your <tr> to read: <tr id="yourID" runat="server">. Then in your CodeFile you can access its properties, such as yourID.Visible!
Very simple, but hey, the best tricks are.
RSS Feed
your blog provided we little
necessary info on this topic.
The post really necessary.
Good! that wos i needed ! Thank you
Thanks!
wow thanks!!
Yeah, wowwowwow! Wond’ring though why u’re against tables, since they seem like a must for a decent layout in web pages.
thanks, im learning asp .net the hard way, by developing a critical app for our company
. ive struggling with this for a day and a half, so a big thanks.
Nice and easy. Thanks!!