I was updating an old project with a new feature a customer requested and found a frustrating problem.
In this particular case, there is an html table in my aspx where a table row is set as runat="server" so the visibility state could be controlled in the aspx.cs. Here's a rough concept of it:
<table> <tr runat="server" id="tr_1"><td></td></tr> </table>
Here's the issue.
tr_1.Visible=true; if(!tr_1.Visible) DoesntMakeSense(); // should never happen, but does.
On my next postback, tr_1.Visible is true.
Actual server controls like Panel/Label/TextBox/etc when you set the Visible status, checking immediately after gives the status I just set.
Is there some sort of commit function I need to run to make sure ASP.NET gives me the proper status on generic html elements that are runat="server"?
Note, this is a "what do I do to make this work as expected?" not a "what alternatives do I have to doing this" question.