开发者

Routing in ASP.NET MVC

开发者 https://www.devze.com 2022-12-22 02:38 出处:网络
I want to identify categories in my site in url not by id, but by its name开发者_如何转开发. When i\'m adding category, which name contains \"+\" symbol - i have 404 error. This situation is on produc

I want to identify categories in my site in url not by id, but by its name开发者_如何转开发. When i'm adding category, which name contains "+" symbol - i have 404 error. This situation is on product internet server, when i'm deploying on local visual studio server - all work fine. Please, suggest me smth.

Example:

routes.MapRoute(

"Default",

"{controller}/{action}/{id}",

new { controller = "Home", action = "Catalog", id = "" }

);

http://wazy.ru/Catalog/Category/18+


Server wont throw 404 error when category names wrong. I think IIS cannot reach-invoke controller or action. Maybe this link help to figure out how to deploy.

0

精彩评论

暂无评论...
验证码 换一张
取 消