Hello Experts,
I have Div in Front end like this.
<div id="frontDiv" style="float:left;">
I want to give background image from .net backend Like this
DivFront.Attributes.Add("s
tyle", "background-Image:url(
http://localhost/Templates/Products/POD/VCA/dog.JPG)");
but it's not taking background image for that DIV.I really don't know is there any other method for giving background-image for DIV.
Please guide me in this.
Is there any specific reason for assigning background color to div from code behind?
Better approach is using CSS.
Here is exmple:
Open in new window
Is still you want to use it from code behind then you have to make that div as server side control so that you can access it from code behind or simply you can take Panel control and use it's "BackImageUrl" property to assign background image.