I have an image from an Url.Action, like this
<img src="<%= Url.Action("Image") %>" alt="" />
How can I set this image as a background to a div? I tried this:
<div style="background-image:url(/Background/Image)"></div>
and others, but no success, I’m trying to play with JS over that div, and I need that background.
Try using Url.Content. I was recently trying to do the same thing for my JavaScript files and I found out about Url.Content from this blog.
For your DIV, I’d do (shortened for readability):