Easy one to explain. Is there any way I can do this:
<div id="header" style='<asp:Literal runat="server" ID="litBackgroundImage"></asp:Literal>' >
It looks valid, but Visual Studio will not recognise litBackgroundImage as a valid control in the code-behind. Setting the div as runat=”server” won’t work either because the style property is read-only.
Any suggestions gratefully received
Add
runat="server"to your div and then you can access it from server-side, so you can set thestyleattribute dynamically.