c# - changing css class from code behind variable - way to avoid? -
I need to change the background of a div based on some count property set in the back key. But I am thinking that this is a good practice if I have to change the counting logic, then I have to update the code vs. HTML. I think that jakoji can not do it until my page has a hidden variable according to the count. Is the loop better than writing logic within HTML?
html Behind the code It's a good practice I have to live with it if you want to do it with jQuery, then you can expose the
& lt; Div class = "show & lt;% = CSSClass%>" & gt; Value & lt; / Div & gt; Return
public string CSSClass {(if (count> 1) return "glossy" ; And if (count == 0) "normal" return; return "dim";}}
Comments
Post a Comment