Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 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!

like image 231
Ray Avatar asked Feb 20 '11 18:02

Ray


1 Answers

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).

like image 80
Darin Dimitrov Avatar answered Nov 17 '22 06:11

Darin Dimitrov