Use a <asp:Panel> and set it in codebehind.

The only reason im saying this is that the div doesnt expose any
properties to the server. an asp:Panel renders as a div, and you can
change its properties in codebehind/codeonpage. They only option you
have to change a div's background is JavaScript.

On Thu, Jan 8, 2009 at 1:36 PM, MrCyber <[email protected]> wrote:
>
> Ok, after yesterday's problem I have a new one that I can't seem to
> figure out.
>
> I have a SqlDataSource on my page which pulls in the TeamBackground
> field among others. I want to use the data in this field (a filename)
> to set the background of a <DIV> based on this information.
>
> I tried:
> <div id="DisplayTeamData" runat="server" style='background-image: url
> (Graphics/Background/<%#Eval("TeamBackground")%>)'>
> Bunch of text here
> </div>
>
> but that doesn't work as it literally puts "Graphics/Background/<%Eval
> ("TeamBackground")%>" as the background image.
>
> Anyone any idea on how to solve this?
>
> (I'm using C#, so if this needs to be solved in code behind C# code
> would be appreciated)
>

Reply via email to