开发者

ASP.NET MVC 400 Bad Request with URL restricted characters such as %

开发者 https://www.devze.com 2023-02-12 19:22 出处:网络
I\'m developing an ASP.NET MVC 3 blog application using VS10 and its asp.net development server, and today I encountered the \"HTTP Error 400 - Bad Request\" error when I request on a blog开发者_如何学

I'm developing an ASP.NET MVC 3 blog application using VS10 and its asp.net development server, and today I encountered the "HTTP Error 400 - Bad Request" error when I request on a blog开发者_如何学JAVA post with a slug that has these chars "doesn%25e2%2580%2599t" in it.

I thought the "%" char is allowed in the URL, for example, on StackOverflow you have https://stackoverflow.com/questions/tagged/c%23 and this link shows you all questions tagged with c#. So what is the difference for my URL and how do you fix it? Could anyone explain.

Thank you so much!


You may checkout the following blog post in which Scott Hanselman explains how you could enable special characters in urls. Don't get too fancy though, it's still pretty limited. You might also checkout the following post to see how this is implemented on SO (the post is pretty old and things might have changed since but still good source for information).

0

精彩评论

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

关注公众号