I can appreciate your opinion, I had the same opinion for a while too.
But, I've since "moderated" it a bit,
- i save codebehind for the hard core database / file interaction stuff, stuff that wouldnt change during a website look and feel overhaul...
- most rendering logic is written inline [via <SCRIPT runat=server>], just because it's a ton easier to change, doesnt require the recompile of the codebehind
That's really the reason that I use the old style render blocks <% %> and expression blocks <%= %>
but frankly in your example, you'd see me write it into the page itself:
<SCRIPT runat=server>
bool showConditionA = whatever;
if( showConditionA ){
ConditionATR.Visible = true;
ConditionBTR.Visible = false;
}
else{
ConditionATR.Visible = false;
ConditionBTR.Visible = true;
}
</SCRIPT>
----
E.Newton
ASP.Net/C# Solutions Developer and Consultant
Ensoft Software
http://www.ensoft-software.com/
[email protected] (Remove the CC)