MVC2网址与破折号(MVC2 Url with a dash)
我有一个名为DataGrowth.aspx的视图(页面),我该如何在浏览器中显示它,如下所示:
HTTP://本地主机/解决方案/数据增长/
试图用ASP.Net MVC2做到这一点
谢谢
I have a view (page) called DataGrowth.aspx, how can I display it in the browser like so:
http://localhost/Solutions/Data-Growth/
Trying to do this with ASP.Net MVC2
Thanks
最满意答案
你添加一个
[ActionName("Data-Growth")]属性到Controller Action。 然后,您可以选择将视图重命名为Data-Growth.aspx,或者将您的返回语句修改为
return View("DataGrowth");You add an
[ActionName("Data-Growth")]attribute to the Controller Action. You can then choose to rename your View to Data-Growth.aspx or simply modify your return statement to
return View("DataGrowth");更多推荐
发布评论