"<%# %>"
is a DataBinding expression. On the other hand, <%= %> is an expression that simply executes in server as Response.Write("") and outputs something int the browser.
Suppose you use a Server control that has a DataSource property and this is Template based (GridView,DataList etc) Server control. Now if you bind the datasource of that control with some compatible data (Say, a collection), at runtime, you can bind a property of an object within that datasource to a control within the template of the control. See
http://msdn.microsoft.com/en-us/library/ms178366.aspx[
^] to learn more.
In your case, you want to output your class name based upon a condition. So, you should yous "<%= %>" expression and hence, this is working.
Obviously, as you are not using any Template based Server control here and you are not binding any datasource. So, the databinding expression "<%# %>" is not working.