Avatar of BrogansMom
BrogansMom
 asked on

Conditional format table without codebehind

I inherited a project with a giant table in an aspx page that has a TON of inline code. Now I need to conditionally style a row based on the value of a textbox in the table. Unfortunately, I can't add a "runat=Server" tag to the table row because of all the embedded <% %> tags. I just need to apply the style to this row. I know all this embedded stuff needs to move to the code behind. I didn't write this - I just need to get this one small thing fixed.

        <ajax:Accordion ID="Accordion1" runat="server" FadeTransitions="False"  
            SelectedIndex="0" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent">
                <HeaderTemplate>
                    <div style="height:20px;">&nbsp;</div>
                    <table class="cart" >
                        <tbody>
                        <ItemTemplate>      
                                <tr class="row I need to style  " >                                   
                                <%if (Isvalid) { %>.... tons more tags like this in the td sections.

Any advice?
C#ASP.NET

Avatar of undefined
Last Comment
BrogansMom

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
xeonol

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
BrogansMom

ASKER
After walking away for a bit, I tried putting an asp panel around it and then setting visibility of the panel in the code behind. Working perfectly now. Accepting switch because that would have worked as well.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes