mapping querystring包含特殊字符 [英] mapping querystring contains special character

查看:293
本文介绍了mapping querystring包含特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过查询字符串在WEB api中映射到以下操作的路径是product-Id:347DCYA3-FE25







这是路线配置







config。 Routes.MapHttpRoute(product,product / {productId},new {controller =product,action =get});







route







routes.MapRoute (默认,{controller} / {productId},新{controller =product,







action =get,id = UrlParameter.Optional});







在控制器中[httpget] public void get(string productId){}







i已经解码了value product-Id:347DCYA3-FE25并将其作为查询字符串传递仍然不会..... ..... div class =h2_lin>解决方案

How we can a map a route to the below action get in WEB api with query string is product-Id:347DCYA3-FE25



this is the route configuration



config.Routes.MapHttpRoute("product", "product/{productId}", new { controller = "product", action = "get" });



route



routes.MapRoute("Default", "{controller}/{productId}", new { controller = "product",



action = "get", id = UrlParameter.Optional });



in controller [httpget] public void get (string productId) { }



i have decoded the value product-Id:347DCYA3-FE25 and pass it as query string still it will not take.....

解决方案

这篇关于mapping querystring包含特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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