带有破折号的MVC2 Url

时间:2011-02-23 14:04:04

标签: .net asp.net asp.net-mvc-2

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

http://localhost/Solutions/Data-Growth/

尝试使用ASP.Net MVC2

执行此操作

由于

1 个答案:

答案 0 :(得分:6)

您添加

[ActionName("Data-Growth")]

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

return View("DataGrowth");