Cum puteti avea caractere nepermise in path

Am avut o problema aparent minora cu ASP.NET MVC . Aveam un path de forma /client/view//client/view/http://localhost/<numevirtualdir>/client/view/<nume client>

Foarte bine si frumos – dar stiati ca nu accepta caractere ciudate in path ( de exemplu, ampersant :, A&D Servicii SRL) . Eroarea este :

This error (HTTP 400 Bad Request) means that Internet Explorer was able to connect to the web server, but the webpage could not be found because of a problem with the address.

For more information about HTTP errors, see Help.

Am cochetat cu ideea sa schimb denumirea – si sa pun codul lor – dar supriza : codul era non-numeric  : A&DS …

Am inlocuit, fara sa ma gindesc prea mult, & cu &amp;  – aceeasi eroare, normal!

In cele din urma, dupa cautari amarnice( 2 ore…) pe internet, am dat de un fisier .reg cu 2 rinduri – sper sa va fie de folos :

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET]
"VerificationCompatibility"=dword:00000001

2 thoughts on “Cum puteti avea caractere nepermise in path

Leave a Reply

Your email address will not be published. Required fields are marked *