MVC2网址与破折号(MVC2 Url with a dash)

编程入门 行业动态 更新时间:2024-10-24 08:20:12
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");

更多推荐

本文发布于:2023-04-29 09:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335895.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:破折号   网址   Url   dash

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!