MVC 3を使用していますが、問題があります。私が期待したようにmydomain/mydirectory / itemを与える代わりに、私はこれを手に入れます:
mydomain / mydirectory / list?animal=quack。
これがグローバルなルートです
//Default route mapping
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new { controller = @"[^\.]*", action = @"[^\.]*" }
);
リンクを構築する方法を示すコード:
<div id="main-content" title="AnimalBox" style="float:none;"> <% Html.DataList(Model.PriceListAnimals).Columns(7).Item(item => { item.Template(galleryImage => {%> <div style="margin-left:20px; line-height:150%;"> <span><%= Html.ActionLink(galleryImage.AnimalName,"List",new { @animal = galleryImage.AnimalName }) %></span> </div> <% }); }).Render(); %> </div>
何か案は?