在IIS中部署MVC4应用程序后,后台映像无法正常工作

时间:2015-05-12 18:27:46

标签: css .net html5 asp.net-mvc-4

我有一个在MVC4中开发的网站,一切正常,直到我在iis中部署它。部署背景图像后根本没有加载

<style>
        .testt {
            background-image: url("../../Images/master/background-Mid.bmp");
            width: 100%;
            height: 100px;
        }
    </style>

</head>
<body>    
 <header style="position: relative; top: -20px ">
     <div class="testt">

        <div style="float:right;width:20%;margin-right:10%"><img src="~/Images/master/Right.bmp" /></div>
        <div style="float:right;width:5%"> <img src="~/Images/master/tstLogo.gif"/></div>
      <div style="float:left;width:5%"> <img src="~/Images/master/Left.bmp" /></div>
         </div>

        </header>

此处背景图片background-Mid.bmp在iis中部署后未出现

1 个答案:

答案 0 :(得分:0)

最后我发现解决方案@Url.Content(~path to image)将解决各种问题