开发者

In .Net-MVC Url "\" converts to "/" automatically, How to prevent that?

开发者 https://www.devze.com 2023-02-05 21:46 出处:网络
One of my route map is BO/{businessObjectTypeId}/{*businessObjectId} So, any url like //localhost/BO/2/zs%5cbbal, properly maps to the above route map. If you notice I am sending zs\\bbal as the b

One of my route map is

BO/{businessObjectTypeId}/{*businessObjectId}

So, any url like //localhost/BO/2/zs%5cbbal, properly maps to the above route map. If you notice I am sending zs\bbal as the businessObjectId(used %5c to escape \).

N开发者_开发百科ow the problem is when I get the businessObjectId in the specified action it is zs/bbal, instead of zs\bbal. I tried many other "Unsafe characters" and they seems to appear properly. It's just the \ that converts itself to /.

Is it normal? Cannot we pass \ as it is or by escaping it? Any help will be appreciated.


Did you try %5c%5c to escape (\\)?

0

精彩评论

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