Link to home
Start Free TrialLog in
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?
ASKER CERTIFIED SOLUTION
Avatar of xeonol
xeonol
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BrogansMom
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.