Using scripting code like that probably isn't going to work. I don't think you can mix script in with templated controls: the script is interpreted at a different time from the databinding.
What you could do, though, is have a UserControl in your ItemTemplate that defines a property for ColB
and displays different markup depending on COL_B
's value.
<ItemTemplate>
<span class="item_title"><%# Eval("COL_A")%></span><br/>
<uc1:UserControl1 runat="server" ColB='<%# (int)Eval("COL_B") %>' />
</ItemTemplate>
Then in your user control markup you have two or more Panel controls:
<asp:Panel id="panel1" runat="server">
<span>SOMETHING HERE</span>
</asp:Panel>
<asp:Panel id="panel2" runat="server">
<span>DIFFERENT MARKUP HERE</span>
<span>SOMETHING COMPLETELY DIFFERENT HERE</span>
</asp:Panel>
... and then in your PreRender event in the user control code-behind (don't use Load, because your binding in the parent won't have happened yet):
panel1.Visible = false;
panel2.Visible = false;
if(this.ColB > 100)
panel1.Visible = true;
else
panel2.Visible = true;
You could promote those two Panel controls to your parent page, but then you'd have to do a .FindControl() call in the ItemDataBound event handler in order to change their properties, and extract COL_B
's value from the e.Item.DataItem property. Lots of retrieving values and casting.