Metronic (4.5.2) setup background images in LoginPage when I use ASP.NET MVC 5 project

59 Views Asked by At

This is an example loginPage in Metronic Sample document. I copy this code to my ASP.NET MVC 5 project. But LoginPage does not show background images.

This is the Metronic example loginPage: Metronic example loginPage

Code in ASP.NET MVC 5: Code in ASP.NET MVC 5

Run result: Run result

Markup:

    <div class="col-md-6 bs-reset">
        <div class="login-bg" style="background-image:url(~/Scripts/assets/pages/img/login/bg1.jpg)">
            <img class="login-logo" src="~/Scripts/assets/pages/img/login/logo.png" />
        </div>
    </div>

Please help me! Thanks

1

There are 1 best solutions below

1
IceCode On

Try setting the background-image like the following:

background-image:url(Scripts/assets/pages/img/login/bg1.jpg)

Without the ~/ part in the path.