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 & lt; Div class = "show & lt;% = CSSClass%>" & gt; Value & lt; / Div & gt; Return Behind the code public string CSSClass {(if (count> 1) return "glossy" ; And if (count == 0) "normal" return; return "dim";}} It's a good practice I have to live with it if you want to do it with jQuery, then you can expose the count server side property to the client and the same logic on the client Can be displayed though. Please, because this is done on the client because there may be some delay after the page is presented, and the jQuery code h...