Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: How to use IImageFile in a Razor function with background-image url

$
0
0
Make sure to put quotes around your url, then it should work just fine.
MediaUrls.BuildUrl()
is infrastructure code and not intended to be called from ie. a razor view like in your example.

Not using quotes or doublequites IS supported by css, but as soon as you have whitespace or special characters in the url, its required. Since we can't now before at runtime if the media-url will contain any special characters due to the path of the media item, C1 requires quotes to prevent accidentally generating an url which will break the css.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>