2016-12-06 106 views

回答

0

你可以achive它在兩個方面

在你的路由配置:

routes.MapPageRoute("Yourhtmlroute","Yourcustomurl","Path/To/Your/test.html"); 

在控制器:

return Redirect("YourCustomUrl"); 
+0

if **「Path/To/Your/test.html」**是html文件路徑,那麼**「Yourhtmlroute」**是什麼? –

+0

http://localhost/smartpond/MyPage.html(working),但http:// localhost/smartpond/MyPage不工作 routes.MapPageRoute(「MyPage.html」,「MyPage」,「〜/ MyPage.html」 ); – Swapna

+0

錯誤 - VirtualPath必須是以〜/開頭的非空字符串。 參數名稱:virtualPath – Swapna