I find that code gets messy fast when C# code is used to modify CSS values. Perhaps a better approach is for your code to dynamically set the class attribute on the div tag and then store any specific CSS settings in the style sheet.
That might not work for your situation, but its a decent default position if you need to change the style on the fly in server side code.