ASP.NET MVC:获取小写链接(而非驼峰) [英] ASP.NET MVC: Get lowercase links (instead of Camel Case)

查看:134
本文介绍了ASP.NET MVC:获取小写链接(而非驼峰)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所有的动态生成的操作链接等创建如/ A ccount / 取值 etup联系。这看起来很奇怪。

All my dynamically generated action links etc. are creating links like /Account/Setup. It looks strange.

我想我所有的环节是小写(意思/帐号/设置)。没有办法做到这一点?

I'd like all my links to be lowercase (meaning /account/setup). Any way to do this?

推荐答案

看看的 http://goneale.com/2008/12/19/lowercase-route-urls-in-aspnet-mvc/ 。您可以在<一个找到另一个计算器的更多信息href="http://stackoverflow.com/questions/878578/how-can-i-have-lowercase-routes-in-asp-net-mvc">http://stackoverflow.com/questions/878578/how-can-i-have-lowercase-routes-in-asp-net-mvc.

在其他职位迄今还没有解决,你导航到你的网页目录的根目录的情景。如果您有定向到HomeController的Index操作映射,你想下面的网址出现:

The other posts thus far have not tackled the scenario where you navigate to the root of your web directory. If you have a mapping that directs to the HomeController Index action, you would like the following URL to appear:

mysite的/家庭/ 甚至 mysite的/家庭/指数

HTML辅助函数的用法再多将改变的事实是,在默认情况下,下面将在浏览器的地址栏中显示为:

No amount of Html helper function usage will change the fact that, by default, the following will be shown in the browser location bar:

的mysite /首页的mysite /首页/指数

这篇关于ASP.NET MVC:获取小写链接(而非驼峰)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆