在IIS7上加载FineUI axd文件时出现404错误

时间:2018-01-07 04:32:43

标签: asp.net asp.net-mvc iis-7 axd

我在IIS7上部署了FineUI示例项目,但在加载.axd文件时从http网络获得了404错误。知道根本原因吗?

1 个答案:

答案 0 :(得分:1)

可能是由IIS7集成模式引起的。如果是IIS集成模式,则需要向system.webServer部分添加信息:

.grid .mini

完整的System.WebServer如下:

/* for the sake of demonstration */

* {
  box-sizing: border-box;
}

.grid {
  max-width: 500px;
  text-align: center;
  border: 1px solid;
  position: relative; /* required to position absolutely nested element relative to contianing element and not windowe */
  margin-top: 50px;
}

.grid div img {
  max-width: 100%;
}

.grid .mini { /* be more specific with your selectors */
  background-color: white;
  z-index: 100;
  border-radius: 0;
  position: absolute;
  left: 0;  /* required to align horizontally center */
  right: 0;  /* required to align horizontally center */
  top: -20px; /* adjust accordingly as per requirements */
  margin: auto;  /* required to align horizontally center */
  max-width: 200px;
  padding: 10px;
  border: 1px solid;
}

如果IIS是经典模式,需要在system.web部分下面添加httpModules和httpHandlers:

<div class="grid">
  <div>
    <div class="mini">DESTINATIONS</div>
    <img src="https://placehold.it/500x300" alt="альтернативный текст">
    <h2>Top destinations to visit</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin efficitur lorem eu est suscipit aliquam. In lectus magna, sagittis in est sed, tempus fringilla neque.</p>
    <h4>READ MORE</h1>
  </div>
  <div>item-2</div>
  <div>item-3</div>
  <div>item-4</div>
  <div>item-5</div>
  <div>item-6</div>
  <div>item-7</div>
  <div>item-8</div>
  <div>item-9</div>
  <div>item-10</div>
  </div

在VS中进行开发时,将使用默认的内置IIS Express服务器。您可以轻松地将IIS Express更改为Classic或Integrated Mode。 1.在VS中选择项目,然后单击F4。 2.显示属性窗口,更改模式。