带有句点的 ASP.NET MVC 路由 ID [英] ASP.NET MVC Route IDs with a period

查看:17
本文介绍了带有句点的 ASP.NET MVC 路由 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的路线如下:

{controller}/{action}/{id}

我查看以下网址:

c1/a1/abc.

它不起作用.这仅在句点位于 URL 末尾时发生.有什么方法可以让 ASP.NET MVC 将其识别为 ID 的一部分?

It doesn't work. This only happens when the period is at the end of the URL. Any way to get ASP.NET MVC to recognize that as part of the ID?

推荐答案

通读以下两个类似问题的答案,我只能建议您在将句点传递给您的 MVC 应用程序之前对其进行编码.看起来句点也被视为/"等规则的分隔符.

Reading through the answers to the two similar problems below, I only can suggest that you encode the period before passing it to you MVC application. It looks as the period is also treated as a delimter to a rule succh as "/".

这里有类似的问题:

这篇关于带有句点的 ASP.NET MVC 路由 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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