the only way I got it working was too set the asset in a style block and load it that way
<style> .custom-background-image { background-image: url(~/assets/images/bg.jpg); } </style>
<div class="custom-background-image"> Content of the div here </div>