我注册了以下路线;
routes.MapRoute(
"LocationsByArea",
"Locations/{system}/{storage}/{area}",
new { controller = "StorageLocation", action = "Index" },
null
);
...以及我认为的以下代码;
<%= Html.ActionLink("Platser", "Index", "StorageLocation", new { system = Model.System, storage = Model.Storage, area = item.Name }, null)%>
我的问题是当“area = item.Name”包含冒号时,例如“Area 4:1”。如果我单击呈现的链接,我会收到 HTTP-error 400,Bad reqest。我想我必须以某种方式对我的区域参数进行编码,但我不知道如何。任何帮助都将不胜感激。
谢谢!