Refining the scenario Thanks to AgaveJoe
on IIS
- it runs on Edge
- it runs on firefox
- it fails on chrome - even after disabled all plugins - Version 101.0.4951.67 (Official Build) (64-bit)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I Blazor WASM .net 6 visual studio 2022
I am trying to pass a negative parameter between pages but it doesn't work - it always pass an extra string '%E2%80%8E' at the beginning
for example if I pass -33333
http://localhost:8082/Counter/%E2%80%8E-33333
if I pass positive number then if works
Now the weird thing is that in debug IT DOES WORK :) - http://localhost:8082/Counter/-33333
but when I publish it to IIS then it disrupts the parameter and add the '%E2%80%8E'
this is just an example but In my real app I do pass negative parameter and it breaks it - it used to work on .net core 3.1.
I am adding screen shots to show you the problem +
the code which is basically nothing - I modified the 2 files from razor suffix to txt so they can be uploaded
Thanks
Arik
Refining the scenario Thanks to AgaveJoe
on IIS
Here's the solution for anyone coming across this post in the future like me. You need to "clean" the int value so it's culture specific before passing it to the NaviateTo function.
int x = -123456789;
var cleaned = x.ToString(CultureInfo.CreateSpecificCulture("en-us"));
NavigationManager.NavigateTo("counter/" + cleaned);