带有破折号的MVC2 Url

RPS*_*RPS 1 .net asp.net asp.net-mvc-2

我有一个名为DataGrowth.aspx的视图(页面),如何在浏览器中显示它,如下所示:

HTTP://本地主机/解决方案/数据增长/

尝试使用ASP.Net MVC2执行此操作

谢谢

小智 6

你添加一个

[ActionName("Data-Growth")]
Run Code Online (Sandbox Code Playgroud)

属性为Controller Action.然后,您可以选择将View重命名为Data-Growth.aspx,或者只需将return语句修改为

return View("DataGrowth");
Run Code Online (Sandbox Code Playgroud)