-1

我想像这样创建我的网址:

www.example.com/Content/page.html

在我的 ContentControler 之上,我使用:

[RoutePrefix("Home")]

在我的索引操作之上,我使用:

[Route("page.html")]

但是当我请求这个 url 时会发生这个错误:

HTTP Error 404.0 - Not Found

我该如何解决这个问题?感谢帮助

4

1 回答 1

0

您需要更改您的web.config才能使其正常工作。在下面的行中添加:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

有关此功能的更多信息:http ://www.iis.net/configreference/system.webserver/modules

于 2014-11-13T11:26:37.700 回答