ASP.NET MVC 3区分大小写的网址 [英] ASP.NET MVC 3 Case Sensitive URLs
问题描述
我在这里做了坏事。我问一个问题而不被跳频有人知道这样做的一个简单的方法是先尝试了。
I am doing a bad thing here. I am asking a question without trying out first by hopping that someone knows an easy way of doing this.
任何机会,我们可以让ASP.NET MVC路由系统区分大小写?我想下面的两个网址是不同的:
Any chance we can make ASP.NET MVC Routing system case sensitive? I would like the following two Urls to be different:
example.com/a
example.com/a
example.com/A
example.com/A
我们有一个简单的办法还是应该写我们自己的处理程序这一点。
Do we have an easy fix or should write our own handler for this.
推荐答案
我还没有尝试过,但我认为,如果你使用一个普通的前pression路由约束,只有匹配了大写和小写独立,这会工作。我不认为这是一个好主意,但。
I haven't tried it, but I would think that if you use a regular expression route constraint that only matched the uppercase and lowercase seperate, that would work. I don't think it's a good idea though.
这篇关于ASP.NET MVC 3区分大小写的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!