私はasp.net mvcで新しく、ルーティングに問題があります。 私は、次のURLを変更しようとしている -route config not working
localhost:2124/Teum/history
に
localhost:2124/Teum/ClosedEvents
routes.MapRoute(
name: "history",
url: "{controller}/{action}",
defaults: new { controller = "Teum", action = "ClosedEvents", id = UrlParameter.Optional }
);
として、ルーティングを使用して、私はここにWeb.configファイルで一つの解決策を見て、それに追加します
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="UrlRoutingModule"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
<handlers>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</handlers>
</system.webServer>
しかし、それはまだ動作しません、いずれかの方法私は404エラーを取得しています。
はどんな種類のヘルプにも感謝します。
actionResultはClosedEventsですが、履歴としてURLに表示したいのですが –